[glib/wip/hadess/update-docker-packages: 1/4] ci: Add podman support
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/hadess/update-docker-packages: 1/4] ci: Add podman support
- Date: Thu, 12 Dec 2019 10:40:32 +0000 (UTC)
commit 265fc7e0209293884bed13a5caf9c82dfdc9b394
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 11 15:44:25 2019 +0100
ci: Add podman support
If podman is used, as is usually the case on a Fedora Workstation
installation, make sure not to use "sudo" as that's not needed, but ask
podman's backend (buildah) to create Docker compatible images.
See https://gitlab.gnome.org/GNOME/glib/merge_requests/1255
.gitlab-ci/run-docker.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh
index 2f2693bc7..d537a7a21 100755
--- a/.gitlab-ci/run-docker.sh
+++ b/.gitlab-ci/run-docker.sh
@@ -15,6 +15,13 @@ read_arg() {
fi
}
+SUDO_CMD="sudo"
+if `docker -v | grep -q podman` ; then
+ # Using podman
+ SUDO_CMD=""
+ BUILDAH_FORMAT=docker
+fi
+
set -e
build=0
@@ -89,7 +96,7 @@ TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}"
if [ $build == 1 ]; then
echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}"
- sudo docker build \
+ $SUDO_CMD docker build \
--build-arg HOST_USER_ID="$UID" \
--tag "${TAG}" \
--file "${base}.Dockerfile" .
@@ -100,16 +107,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" \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]