diff options
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/run-docker-minimal.sh | 33 | ||||
-rwxr-xr-x | .gitlab-ci/run-docker.sh | 32 |
2 files changed, 53 insertions, 12 deletions
diff --git a/.gitlab-ci/run-docker-minimal.sh b/.gitlab-ci/run-docker-minimal.sh index 36b2d376..b090c5eb 100755 --- a/.gitlab-ci/run-docker-minimal.sh +++ b/.gitlab-ci/run-docker-minimal.sh @@ -1,11 +1,32 @@ #!/bin/bash +if [ ! -x "$(command -v docker)" ] || [ 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. + echo "Using: Podman" + format="--format docker" + CMD="podman" +else + echo "Using: Docker" + format="" + CMD="sudo docker" +fi + set -e -TAG="registry.gitlab.gnome.org/gnome/gobject-introspection:min-v1" +REGISTRY="registry.gitlab.gnome.org/gnome/gobject-introspection" +TAG="${REGISTRY}:min-v1" + +${CMD} build \ + ${format} \ + --build-arg HOST_USER_ID="$UID" \ + --tag "${TAG}" \ + --file "minimal.Dockerfile" . -sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \ - --file "minimal.Dockerfile" . -sudo docker run --rm \ - --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ - --tty --interactive "${TAG}" bash +${CMD} run \ + --rm \ + --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ + --tty --interactive \ + "${TAG}" \ + bash diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index ad73d3ba..6c03d8b0 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -1,11 +1,31 @@ #!/bin/bash +if [ ! -x "$(command -v docker)" ] || [ 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. + echo "Using: Podman" + format="--format docker" + CMD="podman" +else + echo "Using: Docker" + format="" + CMD="sudo docker" +fi + set -e -TAG="registry.gitlab.gnome.org/gnome/gobject-introspection:v8" +REGISTRY="registry.gitlab.gnome.org/gnome/gobject-introspection" +TAG="${REGISTRY}:v8" -sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \ - --file "Dockerfile" . -sudo docker run --rm \ - --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ - --tty --interactive "${TAG}" bash +${CMD} build \ + ${format} \ + --build-arg HOST_USER_ID="$UID" \ + --tag "${TAG}" \ + --file "Dockerfile" . +${CMD} run \ + --rm \ + --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ + --tty --interactive \ + "${TAG}" \ + bash |