Docker Community Forums

Share and learn in the Docker community.

Python Service in container - keeps running old code from volume


(Navdocker18) #1

Hi There,

We have multiple python services running in a container and it references other python test scripts from volume. Issue we have is - python services keep using old code from test script files in volume and does not take in the latest changes from the volume.

Service A, Service B - Running inside container.
Volume V - contain the python test script files.

We have to restart container for service to see the latest changes. Any suggestion to solve this?

Note - We are using docker-compose to run multi container application.


(Bodnar) #2

Remove your old volume before running the service again.

docker volume ls then docker volume rm some_volume

Then start your service: docker-compose up -d


(Navdocker18) #3

Does it mean we have to remove the volume each time we have a new version of container?


(Navdocker18) #4

I tried removing the volume and starting services again. It’s still the same issue.