【環境】 MacBook Air (M1, 2020) OS: MacOS Big Sur version11.6 Docker Desktop for Mac version4.5.0 Dockerのvolumesを設定するでホストとコンテナのvolumeをバインドさせることができました。 今回はdocker-compose.ymlでvolumesを設定します。 ディレクトリ構成 ./volumes_test ├── Dockerfile ├── docker-compose.yml └── volumes_test_dir └── test.txt
![docker-composeでvolumesを設定する](https://cdn-ak-scissors.b.st-hatena.com/image/square/745b0c5186654e9a1b71d22f72a5fa21963b6e51/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--9sXnmWPx--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3Adocker-compose%2525E3%252581%2525A7volumes%2525E3%252582%252592%2525E8%2525A8%2525AD%2525E5%2525AE%25259A%2525E3%252581%252599%2525E3%252582%25258B%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3A%2525E3%252581%252582%2525E3%252581%252598%2525E3%252582%252583%2525E3%252581%2525B1%2525E3%252583%2525BC%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyL2Y5OTA4MDZmM2EuanBlZw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)