Linux – Can not start a Docker container

containersdockerflasklinux

I Built an image using flask, nginx and uwsgi.

FROM ubuntu:14.04
MAINTAINER Ali Mezgani <xxxxxxxxx@gmail.com>

RUN apt-get update && apt-get -y install python python-dev  python-pip
RUN apt-get -y install supervisor
RUN apt-get -y install  nginx

COPY ./app /app

RUN mkdir /var/log/uwsgi/

RUN pip install -r ./app/requirements.txt

RUN rm -fr /etc/nginx/conf.d/*
RUN rm -fr /etc/nginx/sites-enabled/*

COPY app.conf /etc/supervisor/conf.d/app.conf

RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/sites-enabled/app.conf

expose 80
CMD ["supervisord", "-n"]
CMD ["nginx"]

Here is the output I get when I try ti start the myapp container.

root@cygne:/data/flask# docker start myapp
Error response from daemon: No such container: myapp
Error: failed to start containers: myapp

And finally here is the status of images I have.

root@cygne:/data/flask# docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              91c4b97dc883        10 hours ago        434.1 MB
myapp               latest              3b9dd7cc7006        10 hours ago        434.1 MB
<none>              <none>              28f96039d2da        10 hours ago        434.1 MB
<none>              <none>              dbd7d20bb041        10 hours ago        434.1 MB
<none>              <none>              f29621c65c25        10 hours ago        434.1 MB
<none>              <none>              7d6d99d831c4        10 hours ago        434.1 MB
<none>              <none>              948cc751026f        10 hours ago        434.1 MB
<none>              <none>              afc13c68670c        10 hours ago        434.1 MB
<none>              <none>              90733b74c1ff        10 hours ago        434.1 MB
<none>              <none>              f8252e26afe5        10 hours ago        424.4 MB
<none>              <none>              4b16f8a9bfbb        10 hours ago        424.4 MB
<none>              <none>              126961e5d0b2        10 hours ago        418.6 MB
<none>              <none>              713635425c68        10 hours ago        400.1 MB
<none>              <none>              0755786fa8dc        10 hours ago        396.2 MB
<none>              <none>              3bc29edbc3a3        10 hours ago        188 MB
ubuntu              14.04               8f1bd21bd25c        3 weeks ago         188 MB
mysql               5.7                 2fd136002c22        3 weeks ago         378.4 MB

The container wont start, and I've tried many process like cleaning cache, restarting docker.
Here is what I have in my syslog :

localhost docker[6111]: time="2016-06-18T15:06:12.826760681Z" level=error msg="Handler for GET /v1.23/containers/myapp/json returned error: No such container: myapp"

Best Answer

You have to use docker run to create a container from an image. See Docker run reference on how to use it.

docker start is to restart previously stopped containers.