I have created a docker image with required packages. I have run the docker image specifying the host and guest port along with the required volume mounting Example:
sudo docker run -it --name CONTAINERNAME -v /host:/guest -p
hostportno:guestportno
My container is up and running fine.
I am trying to migrate my container to a new docker image using docker-compose
.
I have created docker-compose.yml
file and specified the required parameters as shown below:
image: test1
ports
- "1234:123"
- "2000:223"
volumes:
- /home:/test
-container_name: dockercomposetest
working_dir: /test
command: /bin/bash
I am unable to migrate it using docker-compose.
I am getting issue as stated below:
Conflict. The name "test" is already in use by container eeedac72bb25.
You have to delete (or rename) that container to be able to reuse that
name.
Work around currently is I have to stop and remove the container and perform docker-compose up
.
Can I not restart/migrate a container using docker-compose with same name as I have started in normal docker run
process.