0

Hello i am trying to make a nginx server work in container.I have followed this guide : https://www.youtube.com/watch?v=Vyp5_F42NGs

When i run the command docker run --name my-nginx -p 80:80 nginx:1.10.2-alpine instead of the server starting i get the following error:

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: Conflict. The container name "/my-nginx" is already in use by container "06e1b1fdbfa2aff0a977fb73ce7895fd1deb2986080c83a1af5d292f8f3d2791". You have to remove (or rename) that container to be able to reuse that name.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

After i execute docker ps -a i get a docker instance somehow which anyway does not run.

Nginx is created

What am i missing here?

1 Answer 1

0

Docker is unable to bring up your container using the same name because, the name was taken up by the container that was created the first time you executed this command. I see a couple of solutions to this:

  1. Remove the container older container first, and try again:

    $ docker rm my-nginx
    $ docker run --name my-nginx -p 80:80 nginx:1.10.2-alpine
    
  2. Start or restart the old container:

    $ docker restart my-nginx
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .