To overwrite the image tag specified in the Docker Compose file and use a different tag from the CLI, you can use environment variables or override the service configuration.
- Docker Compose
Given the following Docker Compose example:
TAG env var is not set, it falls back to
dev. This allows you to override the tag using the TAG environment variable from the command line e.g.
TAG=my-branch-tag-1 docker-compose up.
In case you face any issues, feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.