Docker Community Forums

Share and learn in the Docker community.

Data volume is always empty

docker
dockercloud

(Santilh) #1

I actually don’t even understand what’s happening in here anymore. Locally with docker-compose, everything works without any problem, here on docker-cloud nothing works.

According to these docs everything should work:

I have 2 containers. One has volume, another one using first container’s volume. When building the first container with auto build from repository, and after that launching service from that repository, the second container doesn’t have files in that volume. Here’s a content:

frontend:
  autoredeploy: true
  command: /bin/echo
  image: 'myname/frontend:latest'
  tags:
    - nodecluster-name=staging-cluster
  volumes:
    - /static
  
 nginx-stag:
    autoredeploy: true
    image: 'myname/nginx:latest'
    ports:
      - '80:80'
    tags:
      - nodecluster-name=staging-cluster
    volumes_from:
      - 'frontend:ro'

Dockerfile:

FROM node:7.2.0
COPY . /frontend
WORKDIR /frontend
RUN npm install webpack -g
RUN npm install
RUN webpack -p --progress && \
     mv /frontend/app/assets/ /static/ && \
     mv /frontend/assets /static
CMD /bin/echo

how it’s done locally: docker-compose.yml

version: '3'
services:

nginx:
   build:
       dockerfile: Dockerfile
       context: ./ui_nginx
   volumes:
     - 'frontend:/static'
   ports:
     - "80:80"

 frontend:
   volumes:
     - 'frontend:/static'
   build:
      context: ./ui_frontend
      dockerfile: Dockerfile
volumes:
   frontend:

It does work locally without any problem at all. if you login to nginx container on docker-cloud and go to /static it’s empty!


(Starakaj) #2

Did you ever find a solution to this? Having the exact same issue.