diff options
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/run-docker.sh | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index 10a9b4816..5f03db853 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -15,6 +15,16 @@ read_arg() { fi } +SUDO_CMD="sudo" +if `docker -v | grep -q podman` ; then + # Using podman + SUDO_CMD="" + # Docker is actually implemented by podman, and its OCI output + # is incompatible with some of the dockerd instances on GitLab + # CI runners. + export BUILDAH_FORMAT=docker +fi + set -e build=0 @@ -88,18 +98,8 @@ fi TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}" if [ $build == 1 ]; then - if docker --help |& grep -q podman; then - # Docker is actually implemented by podman, and its OCI output - # is incompatible with some of the dockerd instances on GitLab - # CI runners. - format="--format docker" - else - format="" - fi - echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}" - sudo docker build \ - ${format} \ + $SUDO_CMD docker build \ --build-arg HOST_USER_ID="$UID" \ --tag "${TAG}" \ --file "${base}.Dockerfile" . @@ -110,16 +110,16 @@ if [ $push == 1 ]; then echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}" if [ $no_login == 0 ]; then - sudo docker login registry.gitlab.gnome.org + $SUDO_CMD docker login registry.gitlab.gnome.org fi - sudo docker push $TAG + $SUDO_CMD docker push $TAG exit $? fi if [ $run == 1 ]; then echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}" - sudo docker run \ + $SUDO_CMD docker run \ --rm \ --volume "$(pwd)/..:/home/user/app" \ --workdir "/home/user/app" \ |