Skip to content

Instantly share code, notes, and snippets.

@y-takagi
Last active June 30, 2016 04:50
Show Gist options
  • Save y-takagi/5ecbe508e7ff17e646db6107456b955e to your computer and use it in GitHub Desktop.
Save y-takagi/5ecbe508e7ff17e646db6107456b955e to your computer and use it in GitHub Desktop.
Data Volume の一例

Data Volume の一例

今回の例では、tmp_dataというData Volumeを作成して、それをhogeコンテナの/tmpにマウントしている。 このとき、DockerfileでVOLUME指定することで、/tmpにあったデータをtmp_dataにCopyしてからマウントすることが出来る。

version: '2'
services:
hoge:
build: .
volumes:
- tmp_data:/tmp
volumes:
tmp_data: {}
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