I have simple commands for making and starting container (create.sh):
docker build -t foo .
docker rm bar
docker create --name=bar foo && \
docker start bar && \
docker exec bar sh /bin/echo Test!!!
Dockerfile:
#/bin/bash
FROM centos:7
RUN yum update -y
But it cannot be started:
$ bash create.sh
Sending build context to Docker daemon 4.608 kB
Step 1 : FROM centos:7
---> 980e0e4c79ec
Step 2 : RUN yum update -y
---> Using cache
---> 80b94205920c
Successfully built 80b94205920c
bar
a1db507225ca7479bdcc3bb3d4e3a86339827f4bf0e9365f507978b11d99df19
bar
Error response from daemon: Container bar is not running
The container has been created but it hasn't started.