docker container using the same volume even after running new container image -


i have f.e. 2 containers in docker

compose.yml

version: '2' services:   nginx:     image: local-nginx:0.3     ports:       - "81:81"     volumes_from:       - webapp   webapp:     image: local-webapp:0.65 

webapp dockerfile

from node:4.3.0 ... volume /www cmd npm run some_script 

so, what's happening, webapp container shares folder /www nginx, , static files serving nginx container. i'm starting app command

docker-compose -f compose.yml 

everything working fine, good. when want example run application version of webapp local-webapp:0.66 change version 0.66 in compose.yml, stop current containers , run again

docker-compose -f compose.yml 

but, still see same version of webapp. when go inside nginx container still see same files previous 0.65. see correct files, must remove containers, , again docker-compose -f compose.yml up.

so, question. how possible configure compose.yml file update volume without removing containers?

this because compose preserves volumes.

if want new data, have 2 options:

  • don't use volume
  • remove containers first

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -