1
votes

I'm using OSX and I have installed Kitematic which uses boot2docker to run docker and containers. I have created a container which needs to mount some local folder under docker folder and doing that with docker-compose:

web:
 build: .
 ports:
  - "9001:9001"
  - "9002:9002"
 volumes:
  - /projects/test /somepath
  - /projects/test2 /someotherpath
 command: ant clean all;./server.sh start

when I run docker-compose up it seems that the volume are not mounted before executing the command phase cause I am getting error logs that /somepathand /someotherpath cannot be found.

I do not understand what is wrong with docker-command configuration.

1
Did you ever manage to solve this? Like you (but using Docker Toolbox), I'm finding that the volume mappings only seem to occur immediately prior to the command being run (but after any 'RUN' statements in the Dockerfile are executed)SimeonJM
I'm having this problem with an ECS taskanthonygore

1 Answers

3
votes

I think you need to replace the space with a colon when mapping volumes. For example:

kafka:
  image: wurstmeister/kafka:0.8.2.1
  hostname: kafka
  ports:
    - "9092:9092"
  links:
    - zookeeper:zk
  environment:
    KAFKA_ADVERTISED_HOST_NAME: kafka
    KAFKA_ADVERTISED_PORT: 9092
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock