compose icon indicating copy to clipboard operation
compose copied to clipboard

VOLUME with volumes not working?

Open jpanganiban opened this issue 12 years ago • 2 comments

I have a fig.yml and an app directory that contains a Dockerfile. It complains that the Gemfile doesn't exist.

## file tree
- app_dir/
  - Dockerfile
  - app.rb
  - Gemfile
- fig.yml
## fig.yml

app:
  build: app_dir
  command: ruby app.rb
  volumes:
    - app_dir/:/deploy
## app_dir/Dockerfile

FROM <some image that contains ruby + bundler>
VOLUME ["/deploy"]
WORKDIR /deploy
RUN bundle install

Doing a RUN echo $(ls) inside the Dockerfile shows that the directory doesn't contain anything.

But doing a fig run and checking the /deploy directory shows that the files mounted from the host are there.

Am I doing something wrong?

jpanganiban avatar Jul 02 '14 18:07 jpanganiban

Docker build doesn't support mounting volumes. They are only used for docker run.

d11wtq avatar Jul 02 '14 23:07 d11wtq

Aha! That explains it. Thanks man!

jpanganiban avatar Jul 03 '14 04:07 jpanganiban