This repository shows how to solve a little problem that I face while I'm developing a new Docker image for my projects. The problem is update a custom image that you're building in your docker-compose.
To understand the problem you must run the project. You can run all containers
docker-compose up
or run only a service:
docker-compose run --rm app
Change the current CMD text in Dockerfile
CMD ["echo", "Hello world!" ]
To anything else like:
CMD ["echo", "Too lazy to write descriptive message" ]
After update the text try to run your container again
docker-compose up
or
docker-compose run --rm app
And it didn't updated the text... 🥲
Everytime you change the image that you're building, you must build the images again running the comando below:
docker-compose up --build
After this your container is correctly updated with the correct image!