How to get docker-compose to always re-create containers from fresh images

0 votes

My docker images are built on a Jenkins CI server and are pushed to our private docker repo. I am currently using docker-compose 1.3.2 as well as 1.4.0 on different machines but we’ve also used older versions previously. I always used the docker-compose pull && docker-compose up -d commands to fetch the fresh images from the registry and start them up. After a point docker-compose up started to re-run previously stopped containers instead of starting the originally built images every time.

Why is this happening all of a sudden.

Jul 27, 2018 in Docker by Hannah
• 18,520 points
4,720 views

1 answer to this question.

0 votes

The containers are getting recreated to preserve any data volumes that might be used.

If you’re doing CI, you don’t need this.

Hence just removing everything might solve the problem

docker-compose rm -f
docker-compose pull
docker-compose up --build -d
# Run some tests
./tests
docker-compose stop -t 1
answered Jul 27, 2018 by Kalgi
• 52,350 points

Related Questions In Docker

0 votes
2 answers
0 votes
1 answer

How to obtain the Docker container's IP address from the host?

This can be done by executing the ...READ MORE

answered Jul 17, 2018 in Docker by Sophie may
• 10,620 points
8,899 views
+1 vote
2 answers
0 votes
1 answer

How to get a browsable url from Docker-for-mac or Docker-for-Windows?

LoadBalancer will work on Docker-for-Mac and Docker-for-Windows ...READ MORE

answered Oct 10, 2018 in Docker by Tyrion anex
• 8,700 points
1,360 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,739 views
0 votes
1 answer

Docker, how to get container information from within the container?

I've found out that the container id ...READ MORE

answered Jul 31, 2018 in Docker by Kalgi
• 52,350 points
963 views
0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 23, 2019 in Docker by Kalgi
• 52,350 points
2,252 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP