今回の例では、tmp_dataというData Volumeを作成して、それをhogeコンテナの/tmpにマウントしている。 このとき、DockerfileでVOLUME指定することで、/tmpにあったデータをtmp_dataにCopyしてからマウントすることが出来る。
Last active
June 30, 2016 04:50
-
-
Save y-takagi/5ecbe508e7ff17e646db6107456b955e to your computer and use it in GitHub Desktop.
Data Volume の一例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
hoge: | |
build: . | |
volumes: | |
- tmp_data:/tmp | |
volumes: | |
tmp_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM image | |
COPY hoge.txt /tmp | |
VOLUME /tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment