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,

enter image description here

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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -