I walked through the initial Docker Compose Overview exactly as it is written, and it works fine locally with boot2docker. However, if I try to do it docker-compose upon a remote host, it does not add code to the remote container.
Playback:
- Launch the original Docker Compose Overview exactly as it is written.
- Install Docker Machine and run Dockerized VM on any cloud provider.
docker-machine create --driver my-favourite-cloud composetesteval "$(docker-machine env composetest)"
- Now that you are working with a remote host, run
docker-compose upin the source code.composetest $ docker-compose up
Redis is working fine, but the Flask app is not working.
composetest $ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
794c90928b97 composetest_web "/bin/sh -c 'python About a minute ago Exited (2) About a minute ago composetest_web_1
2c70bd687dfc redis "/entrypoint.sh redi About a minute ago Up About a minute 6379/tcp composetest_redis_1
Something went wrong?
composetest $ docker logs 794c90928b97
python: can't open file 'app.py': [Errno 2] No such file or directory
Can we confirm this?
composetest $ docker-compose run -d web sleep 60
Starting composetest_redis_1...
composetest_web_run_3
composetest $ docker exec -it a4 /bin/bash
root@a4a73c6dd159:/code
. ..
There is nothing. Can we fix this?
Explain the volumes in docker-compose.yml
web:
build: .
ports:
- "5000:5000"
links:
- redis
redis:
image: redis
docker-compose up !
boot2docker.
composetest $ eval "$(boot2docker shellinit)"
composetest $ docker-compose up
Recreating composetest_redis_1...
Recreating composetest_web_1...
Attaching to composetest_redis_1, composetest_web_1
...
Flask , . app.py, Flask dev , . docker-compose up , . , , . - , docker-compose . , , docker-compose.yml Dockerfile.
Docker docker-compose.yml?
:
- Docker 1.7.0
- Docker Compose 1.3.0
- Docker Machine 0.3.0