Skip to content

Commit d6a4e0e

Browse files
committed
deprecate docker-compose v1: the docker-compose-plugin v2 was released over two years ago and has been available on all major linux distros since docker v20.10.13 in march 2022. v1 has been deprecated since july 2023.
Signed-off-by: Jan Larwig <[email protected]>
1 parent 91a0edc commit d6a4e0e

File tree

12 files changed

+16
-63
lines changed

12 files changed

+16
-63
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please specify the versions of following systems.
1616

1717
- harbor version: [x.x.x]
1818
- docker engine version: [y.y.y]
19-
- docker-compose version: [z.z.z]
19+
- docker compose version: [z.z.z]
2020

2121
**Additional context:**
2222

Diff for: .github/workflows/CI.yml

-25
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ env:
55
POSTGRESQL_USR: postgres
66
POSTGRESQL_PWD: root123
77
POSTGRESQL_DATABASE: registry
8-
DOCKER_COMPOSE_VERSION: 2.27.1
98
HARBOR_ADMIN: admin
109
HARBOR_ADMIN_PASSWD: Harbor12345
1110
CORE_SECRET: tempString
@@ -66,9 +65,6 @@ jobs:
6665
env
6766
#sudo apt install -y xvfb
6867
#xvfb-run ls
69-
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
70-
chmod +x docker-compose
71-
sudo mv docker-compose /usr/local/bin
7268
IP=`hostname -I | awk '{print $1}'`
7369
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
7470
echo "IP=$IP" >> $GITHUB_ENV
@@ -129,11 +125,6 @@ jobs:
129125
pwd
130126
env
131127
df -h
132-
#sudo apt install -y xvfb
133-
#xvfb-run ls
134-
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
135-
chmod +x docker-compose
136-
sudo mv docker-compose /usr/local/bin
137128
- name: install
138129
run: |
139130
cd src/github.com/goharbor/harbor
@@ -184,11 +175,6 @@ jobs:
184175
pwd
185176
env
186177
df -h
187-
#sudo apt install -y xvfb
188-
#xvfb-run ls
189-
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
190-
chmod +x docker-compose
191-
sudo mv docker-compose /usr/local/bin
192178
- name: install
193179
run: |
194180
cd src/github.com/goharbor/harbor
@@ -208,7 +194,6 @@ jobs:
208194
env:
209195
APITEST_LDAP: true
210196
runs-on:
211-
#- self-hosted
212197
- ubuntu-latest
213198
timeout-minutes: 100
214199
steps:
@@ -238,11 +223,6 @@ jobs:
238223
pwd
239224
env
240225
df -h
241-
#sudo apt install -y xvfb
242-
#xvfb-run ls
243-
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
244-
chmod +x docker-compose
245-
sudo mv docker-compose /usr/local/bin
246226
- name: install
247227
run: |
248228
cd src/github.com/goharbor/harbor
@@ -290,11 +270,6 @@ jobs:
290270
pwd
291271
env
292272
df -h
293-
#sudo apt install -y xvfb
294-
#xvfb-run ls
295-
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
296-
chmod +x docker-compose
297-
sudo mv docker-compose /usr/local/bin
298273
IP=`hostname -I | awk '{print $1}'`
299274
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
300275
echo "IP=$IP" >> $GITHUB_ENV

Diff for: .github/workflows/conformance_test.yml

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: CONFORMANCE_TEST
2-
env:
3-
DOCKER_COMPOSE_VERSION: 1.23.0
42

53
on:
64
repository_dispatch:
@@ -40,9 +38,6 @@ jobs:
4038
pwd
4139
env
4240
df -h
43-
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
44-
chmod +x docker-compose
45-
sudo mv docker-compose /usr/local/bin
4641
IP=`hostname -I | awk '{print $1}'`
4742
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
4843
echo "IP=$IP" >> $GITHUB_ENV

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ If you find a match, you can "subscribe" to it to get notified on updates. If yo
348348

349349
When reporting issues, always include:
350350

351-
* Version of docker engine and docker-compose
351+
* Version of docker engine and docker-compose-plugin
352352
* Configuration files of Harbor
353353
* Log files in /var/log/harbor/
354354

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# remove the base images of Harbor images
4949
# cleanimage: remove Harbor images
5050
# cleandockercomposefile:
51-
# remove specific version docker-compose
51+
# remove specific version docker-compose file
5252
# cleanversiontag:
5353
# cleanpackageremove specific version tag
5454
# cleanpackage: remove online/offline install package
@@ -133,7 +133,7 @@ DOCKERRMIMAGE=$(DOCKERCMD) rmi
133133
DOCKERPULL=$(DOCKERCMD) pull
134134
DOCKERIMAGES=$(DOCKERCMD) images
135135
DOCKERSAVE=$(DOCKERCMD) save
136-
DOCKERCOMPOSECMD=$(shell which docker-compose)
136+
DOCKERCOMPOSECMD=$(DOCKERCMD) compose
137137
DOCKERTAG=$(DOCKERCMD) tag
138138

139139
# go parameters

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For learning the architecture design of Harbor, check the document [Architecture
5555

5656
**System requirements:**
5757

58-
**On a Linux host:** docker 20.10.10-ce+ and docker-compose 1.18.0+ .
58+
**On a Linux host:** docker 20.10.10-ce+ and docker-compose-plugin 2.0.0+.
5959

6060
Download binaries of **[Harbor release ](https://github.com/vmware/harbor/releases)** and follow **[Installation & Configuration Guide](https://goharbor.io/docs/latest/install-config/)** to install Harbor.
6161

Diff for: contrib/deploying_using_docker_machine.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ $ docker-machine scp -r ./config harbor.mydomain.com:$PWD
4545
Next, build your Harbor images:
4646

4747
```
48-
$ docker-compose build
48+
$ docker compose build
4949
```
5050

5151
And finally, spin up your Harbor containers:
5252

5353
```
54-
$ docker-compose up -d
54+
$ docker compose up -d
5555
```
5656

5757
Now you should be able to browse `http://harbor.mydomain.com`.

Diff for: make/checkenv.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -o noglob
44
set -e
55

6-
usage=$'Checking environment for harbor build and install. Include golang, docker and docker-compose.'
6+
usage=$'Checking environment for harbor build and install. Including golang and docker.'
77

88
while [ $# -gt 0 ]; do
99
case $1 in

Diff for: make/common.sh

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
#docker version: 20.10.10+
3-
#docker-compose version: 1.18.0+
3+
#docker compose version: 2.0.0+
44
#golang version: 1.12.0+
55

66
set +e
@@ -103,34 +103,18 @@ function check_docker {
103103
}
104104

105105
function check_dockercompose {
106-
if [! docker compose version] &> /dev/null || [! docker-compose --version] &> /dev/null
106+
if [! docker compose --version] &> /dev/null
107107
then
108-
error "Need to install docker-compose(1.18.0+) or a docker-compose-plugin (https://docs.docker.com/compose/)by yourself first and run this script again."
108+
error "Need to install docker-compose-plugin (https://docs.docker.com/compose/)by yourself first and run this script again."
109109
exit 1
110110
fi
111111

112-
# either docker compose plugin has been installed
113112
if docker compose version &> /dev/null
114113
then
115114
note "$(docker compose version)"
116115
DOCKER_COMPOSE="docker compose"
117-
118-
# or docker-compose has been installed, check its version
119-
elif [[ $(docker-compose --version) =~ (([0-9]+)\.([0-9]+)([\.0-9]*)) ]]
120-
then
121-
docker_compose_version=${BASH_REMATCH[1]}
122-
docker_compose_version_part1=${BASH_REMATCH[2]}
123-
docker_compose_version_part2=${BASH_REMATCH[3]}
124-
125-
note "docker-compose version: $docker_compose_version"
126-
# the version of docker-compose does not meet the requirement
127-
if [ "$docker_compose_version_part1" -lt 1 ] || ([ "$docker_compose_version_part1" -eq 1 ] && [ "$docker_compose_version_part2" -lt 18 ])
128-
then
129-
error "Need to upgrade docker-compose package to 1.18.0+."
130-
exit 1
131-
fi
132116
else
133-
error "Failed to parse docker-compose version."
117+
error "Failed to parse docker compose version."
134118
exit 1
135119
fi
136120
}

Diff for: make/install.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ with_clair=$false
1818
# trivy is not enabled by default
1919
with_trivy=$false
2020

21-
# flag to using docker compose v1 or v2, default would using v1 docker-compose
22-
DOCKER_COMPOSE=docker-compose
21+
DOCKER_COMPOSE=docker compose
2322

2423
while [ $# -gt 0 ]; do
2524
case $1 in
@@ -41,7 +40,7 @@ cd $workdir
4140
h2 "[Step $item]: checking if docker is installed ..."; let item+=1
4241
check_docker
4342

44-
h2 "[Step $item]: checking docker-compose is installed ..."; let item+=1
43+
h2 "[Step $item]: checking docker compose is installed ..."; let item+=1
4544
check_dockercompose
4645

4746
if [ -f harbor*.tar.gz ]

Diff for: tests/ci/ut_run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export CHROME_BIN=chromium-browser
99
#export DISPLAY=:99.0
1010
#sh -e /etc/init.d/xvfb start
1111

12-
sudo docker-compose -f ./make/docker-compose.test.yml up -d
12+
sudo docker compose -f ./make/docker-compose.test.yml up -d
1313
sleep 10
1414
./tests/pushimage.sh
1515
docker ps

Diff for: tests/integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set -x
1717
gsutil version -l
1818
set +x
1919

20-
docker-compose version
20+
docker compose version
2121

2222
## -------------------------------------------- Pre-condition --------------------------------------------
2323
if [[ $DRONE_REPO != "goharbor/harbor" ]]; then

0 commit comments

Comments
 (0)