I am confused about how to use a named data volume (rather than a data container).
I have a named data volume app_src that mounts on /usr/src/app using the app_src file. However, after making changes to the source code (locally), creating the image does not update the volume.
I create an image so
docker-compose -f development.yml build and running it docker-compose -f development.yml up -d .
To confirm that the volume does not change, I am attached to the current container and am quite right, the source code is not updated.
Here is my docker compiling development.yml and Dockerfile for my web service. version: '2'
services: web: restart: always build: ./web expose: - "8000" volumes: - app_src:/usr/src/app links: - postgres:postgres env_file: development.env command: ./start_web.sh volumes: app_src: {} FROM python:3.4.4 WORKDIR /usr/src/app RUN rm -rf /usr/src/app/* COPY . /usr/src/app/ RUN pip install --no-cache-dir -r requirements.txt
I could make it work by mounting the host so
volumes: - ./web/src:/usr/src/app
I'm running docker 1.11.2 on Ubuntu 16.04. I understand what is wrong? I looked through the documentation, but I could find everything that explained the volume really well.
docker docker-compose docker-volume
Shulhi sapli
source share