Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): remove docker-compose v1 #21449

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please specify the versions of following systems.

- harbor version: [x.x.x]
- docker engine version: [y.y.y]
- docker-compose version: [z.z.z]
- docker compose version: [z.z.z]

**Additional context:**

Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
POSTGRESQL_USR: postgres
POSTGRESQL_PWD: root123
POSTGRESQL_DATABASE: registry
DOCKER_COMPOSE_VERSION: 2.27.1
HARBOR_ADMIN: admin
HARBOR_ADMIN_PASSWD: Harbor12345
CORE_SECRET: tempString
Expand Down Expand Up @@ -66,9 +65,6 @@ jobs:
env
#sudo apt install -y xvfb
#xvfb-run ls
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
IP=`hostname -I | awk '{print $1}'`
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
echo "IP=$IP" >> $GITHUB_ENV
Expand Down Expand Up @@ -129,11 +125,6 @@ jobs:
pwd
env
df -h
#sudo apt install -y xvfb
#xvfb-run ls
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
- name: install
run: |
cd src/github.com/goharbor/harbor
Expand Down Expand Up @@ -184,11 +175,6 @@ jobs:
pwd
env
df -h
#sudo apt install -y xvfb
#xvfb-run ls
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
- name: install
run: |
cd src/github.com/goharbor/harbor
Expand All @@ -208,7 +194,6 @@ jobs:
env:
APITEST_LDAP: true
runs-on:
#- self-hosted
- ubuntu-latest
timeout-minutes: 100
steps:
Expand Down Expand Up @@ -238,11 +223,6 @@ jobs:
pwd
env
df -h
#sudo apt install -y xvfb
#xvfb-run ls
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
- name: install
run: |
cd src/github.com/goharbor/harbor
Expand Down Expand Up @@ -290,11 +270,6 @@ jobs:
pwd
env
df -h
#sudo apt install -y xvfb
#xvfb-run ls
curl -L https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
IP=`hostname -I | awk '{print $1}'`
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
echo "IP=$IP" >> $GITHUB_ENV
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/conformance_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: CONFORMANCE_TEST
env:
DOCKER_COMPOSE_VERSION: 1.23.0

on:
repository_dispatch:
Expand Down Expand Up @@ -40,9 +38,6 @@ jobs:
pwd
env
df -h
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
IP=`hostname -I | awk '{print $1}'`
echo '{"insecure-registries" : ["'$IP':5000"]}' | sudo tee /etc/docker/daemon.json
echo "IP=$IP" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ If you find a match, you can "subscribe" to it to get notified on updates. If yo

When reporting issues, always include:

* Version of docker engine and docker-compose
* Version of docker engine and docker-compose-plugin
* Configuration files of Harbor
* Log files in /var/log/harbor/

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# remove the base images of Harbor images
# cleanimage: remove Harbor images
# cleandockercomposefile:
# remove specific version docker-compose
# remove specific version docker-compose file
# cleanversiontag:
# cleanpackageremove specific version tag
# cleanpackage: remove online/offline install package
Expand Down Expand Up @@ -133,7 +133,7 @@ DOCKERRMIMAGE=$(DOCKERCMD) rmi
DOCKERPULL=$(DOCKERCMD) pull
DOCKERIMAGES=$(DOCKERCMD) images
DOCKERSAVE=$(DOCKERCMD) save
DOCKERCOMPOSECMD=$(shell which docker-compose)
DOCKERCOMPOSECMD=$(DOCKERCMD) compose
DOCKERTAG=$(DOCKERCMD) tag

# go parameters
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ For learning the architecture design of Harbor, check the document [Architecture

**System requirements:**

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

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.

Expand Down
4 changes: 2 additions & 2 deletions contrib/deploying_using_docker_machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ $ docker-machine scp -r ./config harbor.mydomain.com:$PWD
Next, build your Harbor images:

```
$ docker-compose build
$ docker compose build
```

And finally, spin up your Harbor containers:

```
$ docker-compose up -d
$ docker compose up -d
```

Now you should be able to browse `http://harbor.mydomain.com`.
2 changes: 1 addition & 1 deletion make/checkenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -o noglob
set -e

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

while [ $# -gt 0 ]; do
case $1 in
Expand Down
24 changes: 4 additions & 20 deletions make/common.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#docker version: 20.10.10+
#docker-compose version: 1.18.0+
#docker compose version: 2.0.0+
#golang version: 1.12.0+

set +e
Expand Down Expand Up @@ -103,34 +103,18 @@ function check_docker {
}

function check_dockercompose {
if [! docker compose version] &> /dev/null || [! docker-compose --version] &> /dev/null
if [! docker compose --version] &> /dev/null
then
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."
error "Need to install docker-compose-plugin (https://docs.docker.com/compose/)by yourself first and run this script again."
exit 1
fi

# either docker compose plugin has been installed
if docker compose version &> /dev/null
then
note "$(docker compose version)"
DOCKER_COMPOSE="docker compose"

# or docker-compose has been installed, check its version
elif [[ $(docker-compose --version) =~ (([0-9]+)\.([0-9]+)([\.0-9]*)) ]]
then
docker_compose_version=${BASH_REMATCH[1]}
docker_compose_version_part1=${BASH_REMATCH[2]}
docker_compose_version_part2=${BASH_REMATCH[3]}

note "docker-compose version: $docker_compose_version"
# the version of docker-compose does not meet the requirement
if [ "$docker_compose_version_part1" -lt 1 ] || ([ "$docker_compose_version_part1" -eq 1 ] && [ "$docker_compose_version_part2" -lt 18 ])
then
error "Need to upgrade docker-compose package to 1.18.0+."
exit 1
fi
else
error "Failed to parse docker-compose version."
error "Failed to parse docker compose version."
exit 1
fi
}
Expand Down
5 changes: 2 additions & 3 deletions make/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ with_clair=$false
# trivy is not enabled by default
with_trivy=$false

# flag to using docker compose v1 or v2, default would using v1 docker-compose
DOCKER_COMPOSE=docker-compose
DOCKER_COMPOSE=docker compose

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

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

if [ -f harbor*.tar.gz ]
Expand Down
2 changes: 1 addition & 1 deletion tests/ci/ut_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export CHROME_BIN=chromium-browser
#export DISPLAY=:99.0
#sh -e /etc/init.d/xvfb start

sudo docker-compose -f ./make/docker-compose.test.yml up -d
sudo docker compose -f ./make/docker-compose.test.yml up -d
sleep 10
./tests/pushimage.sh
docker ps
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set -x
gsutil version -l
set +x

docker-compose version
docker compose version

## -------------------------------------------- Pre-condition --------------------------------------------
if [[ $DRONE_REPO != "goharbor/harbor" ]]; then
Expand Down
Loading