0

Is there any way that when I build an image and use the latest tag, it would version those images?

In my compose file I have app:latest as a parameter, but whenever I push the new latest image, it doesn't automatically update.

Is there a way to automatically make compose pull the latest images or do I need to always use docker-compose down, change the version of my image in compose (1.1, 1.2, 1.3...), save it, and then do docker-compose up?

Thanks in advance!

Lord M
  • 67
  • 1
  • 10
  • There's nothing special about the name `latest` other than it being the default tag if you haven't specified one; Docker won't contact the registry if you already have some `latest` version locally. Using an environment variable to specify the `image:` tag could be an easy way to provide it without editing the file. – David Maze Aug 05 '21 at 11:10
  • @DavidMaze Do you have any tutorials for that environment variable versioning? – Lord M Aug 05 '21 at 11:54
  • In `docker-compose.yml` specify something like `image: registry.example.com/name:${TAG-latest}`. Then run `TAG=20210805 docker-compose up` and Compose will use that environment variable for the image tag. – David Maze Aug 05 '21 at 15:17

0 Answers0