Overriding image version in docker-compose file -
i'm working on overriding default docker-compose.yml
file using docker-compose.override.yml
shown in link, , can able specify ports
, volumes
in override file.
in similar way, possible specify version of image needs deployed? if no, best way handle such circumstance need specify different version image?
any on great.
docker having feature. tried override image name simple docker-compose, working.
for example,
docker-compose.yml
content,
my-httpd: image: httpd:latest ports: - "1110:80"
and docker-compose.override.yml
content,
my-httpd: image: httpd:2.4
after execution of docker-compose -d
, here docker ps info,
it uses ports
docker-compose.yml
(not overrided) , image
docker-compose.override.yml
getting overridden here.
note: have different names , location, use following command instead of docker-compose -d
,
docker-compose -f <docker compose location> -f <override file location> -d
edit 2:
overriding in above manner replace non array values , array variables merged.
for example, if have ports
in both files array, bind both ports instead of taking ports value overriding file unlike image
part (non array).
Comments
Post a Comment