I created a docker image with the necessary packages. I launched 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 working fine.
I am trying to migrate my container to a new docker-compose image using docker-compose .
I created the docker-compose.yml and specified the necessary parameters, as shown below:
image: test1 ports - "1234:123" - "2000:223" volumes: - /home:/test -container_name: dockercomposetest working_dir: /test command: /bin/bash
I cannot migrate using docker-compose.
I get the question as 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 now - I need to stop and remove the container and do docker-compose up .
Can I restart / transfer the container using docker-compose with the same name as in a regular docker run process.
source share