LoginSignup
8
7

More than 3 years have passed since last update.

Amazon ECS の Volumes と Bind Mount の仕組み

Last updated at Posted at 2020-03-21

1.Volumes

/var/lib/docker/volumes/ ↔️ /var/www/html

スクリーンショット 2020-03-21 13.46.24.png

管理者権限でログイン

sudo su

/var/lib/docker/volumes/ に移動。

cd /var/lib/docker/volumes/

ll
drwxr-xr-x 3 root root  4096 Mar 21 04:47 80a6b074bf3171ef09d22cfdc17c950986315ec71498fe2c10fe364573a3dcff

80a〜に移動`

cd 80a6b074bf3171ef09d22cfdc17c950986315ec71498fe2c10fe364573a3dcff

ll
drwxr-xr-x 2 root root 4096 Mar 21 04:47 _data

_dataに移動。

cd _data

-rw-rw-r-- 1 root root 111 Mar  9 09:36 index.html

index.htmlを適当に編集し、変更が表示されるか確認する。

index.html
<html>
    <head><title>ecs volumes demo</head></title>
        <body>
this is ecs volumes demo
        </body>
</html>

2.Bind Mount

/root/Volume01 ↔️ /var/www/html

スクリーンショット 2020-03-21 14.09.20.png
スクリーンショット 2020-03-21 14.13.00.png

Volume01 ができているか確認。

sudo su

cd

ll
drwxr-xr-x 2 root root 4096  3月 21 05:14 Volume01

Volume01に適当なindex.htmlを開き、反映されるか確認。

cd Volume01
index.html
<html>
    <head><title>ecs bind mount  demo</head></title>
        <body>
this is ecs bind mount demo
        </body>
</html>

3.リンク

Amazon ECS

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7