From 949607fe908622c8062ba087dae3588f83fedda8 Mon Sep 17 00:00:00 2001 From: Ryan Russell Date: Sun, 16 Oct 2022 16:02:33 -0500 Subject: [PATCH] refactor(compose)!: upgrade to v2 closes #3699 (#3705) * docs(compose): Update readme for compose v2 upgrade Signed-off-by: Ryan Russell * refactor(compose): Upgrade `Makefile` for compose v2 Signed-off-by: Ryan Russell * refactor(compose): Upgrade yml from version 2 -> 3.9 Signed-off-by: Ryan Russell Signed-off-by: Ryan Russell --- docker/Makefile | 34 +++++++++---------- docker/README.md | 14 ++++++-- docker/compose/local-auditlog-compose.yml | 2 +- docker/compose/local-cluster-compose.yml | 2 +- docker/compose/local-clusters-compose.yml | 2 +- docker/compose/local-dev-compose.yml | 2 +- .../compose/local-hashicorp-raft-compose.yml | 2 +- docker/compose/local-k8s-compose.yml | 2 +- .../compose/local-minio-gateway-compose.yml | 2 +- docker/compose/local-mount-compose.yml | 2 +- .../compose/local-mount-profile-compose.yml | 2 +- docker/compose/local-nextcloud-compose.yml | 2 +- docker/compose/local-registry-compose.yml | 2 +- docker/compose/local-replicate-compose.yml | 2 +- docker/compose/local-s3tests-compose.yml | 2 +- docker/compose/test-etcd-filer.yml | 2 +- docker/compose/test-ydb-filer.yml | 2 +- docker/seaweedfs-compose.yml | 2 +- docker/seaweedfs-dev-compose.yml | 2 +- 19 files changed, 46 insertions(+), 36 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index faedb080f..963570622 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -39,63 +39,63 @@ s3tests_build: docker build --no-cache -t chrislusf/ceph-s3-tests:local -f Dockerfile.s3tests . dev: build - docker-compose -f compose/local-dev-compose.yml -p seaweedfs up + docker compose -f compose/local-dev-compose.yml -p seaweedfs up dev_race: binary_race - docker-compose -f compose/local-dev-compose.yml -p seaweedfs up + docker compose -f compose/local-dev-compose.yml -p seaweedfs up dev_tls: build certstrap - ENV_FILE="tls.env" docker-compose -f compose/local-dev-compose.yml -p seaweedfs up + ENV_FILE="tls.env" docker compose -f compose/local-dev-compose.yml -p seaweedfs up dev_mount: build - docker-compose -f compose/local-mount-compose.yml -p seaweedfs up + docker compose -f compose/local-mount-compose.yml -p seaweedfs up run_image: build docker run --rm -ti --device /dev/fuse --cap-add SYS_ADMIN --entrypoint /bin/sh chrislusf/seaweedfs:local profile_mount: build - docker-compose -f compose/local-mount-profile-compose.yml -p seaweedfs up + docker compose -f compose/local-mount-profile-compose.yml -p seaweedfs up k8s: build - docker-compose -f compose/local-k8s-compose.yml -p seaweedfs up + docker compose -f compose/local-k8s-compose.yml -p seaweedfs up dev_registry: build - docker-compose -f compose/local-registry-compose.yml -p seaweedfs up + docker compose -f compose/local-registry-compose.yml -p seaweedfs up dev_replicate: build - docker-compose -f compose/local-replicate-compose.yml -p seaweedfs up + docker compose -f compose/local-replicate-compose.yml -p seaweedfs up dev_auditlog: build - docker-compose -f compose/local-auditlog-compose.yml -p seaweedfs up + docker compose -f compose/local-auditlog-compose.yml -p seaweedfs up dev_nextcloud: build - docker-compose -f compose/local-nextcloud-compose.yml -p seaweedfs up + docker compose -f compose/local-nextcloud-compose.yml -p seaweedfs up cluster: build - docker-compose -f compose/local-cluster-compose.yml -p seaweedfs up + docker compose -f compose/local-cluster-compose.yml -p seaweedfs up 2clusters: build - docker-compose -f compose/local-clusters-compose.yml -p seaweedfs up + docker compose -f compose/local-clusters-compose.yml -p seaweedfs up 2mount: build - docker-compose -f compose/local-sync-mount-compose.yml -p seaweedfs up + docker compose -f compose/local-sync-mount-compose.yml -p seaweedfs up hashicorp_raft: build - docker-compose -f compose/local-hashicorp-raft-compose.yml -p seaweedfs up + docker compose -f compose/local-hashicorp-raft-compose.yml -p seaweedfs up s3tests: build s3tests_build - docker-compose -f compose/local-s3tests-compose.yml -p seaweedfs up + docker compose -f compose/local-s3tests-compose.yml -p seaweedfs up filer_etcd: build docker stack deploy -c compose/swarm-etcd.yml fs test_etcd: build - docker-compose -f compose/test-etcd-filer.yml -p seaweedfs up + docker compose -f compose/test-etcd-filer.yml -p seaweedfs up test_ydb: tags = ydb test_ydb: build export - docker-compose -f compose/test-ydb-filer.yml -p seaweedfs up + docker compose -f compose/test-ydb-filer.yml -p seaweedfs up clean: rm ./weed diff --git a/docker/README.md b/docker/README.md index 07ccbdefa..bec6c4bf9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,5 +1,15 @@ # Docker +## Compose V2 +SeaweedFS now uses the `v2` syntax `docker compose` + +If you rely on using Docker Compose as docker-compose (with a hyphen), you can set up Compose V2 to act as a drop-in replacement of the previous docker-compose. Refer to the [Installing Compose](https://docs.docker.com/compose/install/) section for detailed instructions on upgrading. + +Confirm your system has docker compose v2 with a version check +```bash +$ docker compose version +Docker Compose version v2.10.2 +``` ## Try it out @@ -7,7 +17,7 @@ wget https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/docker/seaweedfs-compose.yml -docker-compose -f seaweedfs-compose.yml -p seaweedfs up +docker compose -f seaweedfs-compose.yml -p seaweedfs up ``` @@ -17,7 +27,7 @@ docker-compose -f seaweedfs-compose.yml -p seaweedfs up wget https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/docker/seaweedfs-dev-compose.yml -docker-compose -f seaweedfs-dev-compose.yml -p seaweedfs up +docker compose -f seaweedfs-dev-compose.yml -p seaweedfs up ``` diff --git a/docker/compose/local-auditlog-compose.yml b/docker/compose/local-auditlog-compose.yml index 39c997448..f57825f27 100644 --- a/docker/compose/local-auditlog-compose.yml +++ b/docker/compose/local-auditlog-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: s3: diff --git a/docker/compose/local-cluster-compose.yml b/docker/compose/local-cluster-compose.yml index f781244ab..13cbcb861 100644 --- a/docker/compose/local-cluster-compose.yml +++ b/docker/compose/local-cluster-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master0: diff --git a/docker/compose/local-clusters-compose.yml b/docker/compose/local-clusters-compose.yml index f9e9a1589..314133312 100644 --- a/docker/compose/local-clusters-compose.yml +++ b/docker/compose/local-clusters-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: server1: diff --git a/docker/compose/local-dev-compose.yml b/docker/compose/local-dev-compose.yml index 5df1e7332..9cdd76dfd 100644 --- a/docker/compose/local-dev-compose.yml +++ b/docker/compose/local-dev-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-hashicorp-raft-compose.yml b/docker/compose/local-hashicorp-raft-compose.yml index 0931b4bc3..4b9814d92 100644 --- a/docker/compose/local-hashicorp-raft-compose.yml +++ b/docker/compose/local-hashicorp-raft-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master0: diff --git a/docker/compose/local-k8s-compose.yml b/docker/compose/local-k8s-compose.yml index 9a25465c4..c73103d92 100644 --- a/docker/compose/local-k8s-compose.yml +++ b/docker/compose/local-k8s-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-minio-gateway-compose.yml b/docker/compose/local-minio-gateway-compose.yml index fafee59c8..13c662e5f 100644 --- a/docker/compose/local-minio-gateway-compose.yml +++ b/docker/compose/local-minio-gateway-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-mount-compose.yml b/docker/compose/local-mount-compose.yml index 8c4329054..6f8847050 100644 --- a/docker/compose/local-mount-compose.yml +++ b/docker/compose/local-mount-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-mount-profile-compose.yml b/docker/compose/local-mount-profile-compose.yml index 20cddae2d..65308bd96 100644 --- a/docker/compose/local-mount-profile-compose.yml +++ b/docker/compose/local-mount-profile-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-nextcloud-compose.yml b/docker/compose/local-nextcloud-compose.yml index 80c3fca53..288ae06e5 100644 --- a/docker/compose/local-nextcloud-compose.yml +++ b/docker/compose/local-nextcloud-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-registry-compose.yml b/docker/compose/local-registry-compose.yml index b61278d66..9b66bcb40 100644 --- a/docker/compose/local-registry-compose.yml +++ b/docker/compose/local-registry-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-replicate-compose.yml b/docker/compose/local-replicate-compose.yml index 8240d45a7..d88a54101 100644 --- a/docker/compose/local-replicate-compose.yml +++ b/docker/compose/local-replicate-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/local-s3tests-compose.yml b/docker/compose/local-s3tests-compose.yml index 952a9165c..f1961700c 100644 --- a/docker/compose/local-s3tests-compose.yml +++ b/docker/compose/local-s3tests-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/compose/test-etcd-filer.yml b/docker/compose/test-etcd-filer.yml index 400bd0fae..37c074974 100644 --- a/docker/compose/test-etcd-filer.yml +++ b/docker/compose/test-etcd-filer.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: etcd: diff --git a/docker/compose/test-ydb-filer.yml b/docker/compose/test-ydb-filer.yml index c0c31fe5b..ddbfe18d0 100644 --- a/docker/compose/test-ydb-filer.yml +++ b/docker/compose/test-ydb-filer.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: ydb: diff --git a/docker/seaweedfs-compose.yml b/docker/seaweedfs-compose.yml index cce1c39ef..28ed97b43 100644 --- a/docker/seaweedfs-compose.yml +++ b/docker/seaweedfs-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: diff --git a/docker/seaweedfs-dev-compose.yml b/docker/seaweedfs-dev-compose.yml index 0b11e72e4..8e0fd2a85 100644 --- a/docker/seaweedfs-dev-compose.yml +++ b/docker/seaweedfs-dev-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.9' services: master: