概要 2021年の後半にDocker Compose V2がリリースされました Docker Compose V2はCompose Spec[1]に準拠しているため、docker-compose.ymlもその仕様に則った書き方ができるようになっています services: app1: image: awesome/webapp configs: - my_config secrets: - server-certificate app2: image: awesome/database extends: service: app1 configs: my_config: file: ./my_config.txt secrets: server-certificate: file: ./server.cert services: app1: configs: - source: my_co
![Docker Compose V2で変わったdocker-compose.ymlの書き方](https://cdn-ak-scissors.b.st-hatena.com/image/square/0080673cf19fba8dd1176e754ea2f32003972fff/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs---IJj04IV--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3ADocker%252520Compose%252520V2%2525E3%252581%2525A7%2525E5%2525A4%252589%2525E3%252582%25258F%2525E3%252581%2525A3%2525E3%252581%25259Fdocker-compose.yml%2525E3%252581%2525AE%2525E6%25259B%2525B8%2525E3%252581%25258D%2525E6%252596%2525B9%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_37%3Akagamirror%252Cx_203%252Cy_121%2Fg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EtL0FPaDE0R2l1dzRRbDlKTEpkX0JhUkJ5c2VOUldNd2FvbW1fZ3JHbThxbTNlPXMyNTAtYw%3D%3D%252Cr_max%252Cw_90%252Cx_87%252Cy_95%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)