diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-07-13 10:47:20 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-07-13 10:47:20 +0200 |
commit | 20132eefecd6df5ff72166d80fa02751b41b677e (patch) | |
tree | 0cf643a221eb0cc3734bb80af17a67b2cd96891d | |
download | podman-docker-builder-20132eefecd6df5ff72166d80fa02751b41b677e.tar.gz |
initial commit
-rw-r--r-- | .gitlab-ci.yml | 13 | ||||
-rw-r--r-- | Dockerfile | 17 | ||||
-rwxr-xr-x | configure-podman | 13 |
3 files changed, 43 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c5ba61a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +image: centos:8 + +stages: + - build + +Build: + stage: build + script: + - dnf install -y podman buildah + - ./configure-podman + - podman login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - podman build --tag $CI_REGISTRY_IMAGE:latest . + - podman push $CI_REGISTRY_IMAGE:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f059589 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM centos:8 + +ENV SUMMARY="podman-docker-builder" \ + DESCRIPTION="build docker images using podman" + +LABEL maintainer="Gerd Hoffmann <kraxel@redhat.com>" \ + summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + +USER root + +RUN dnf update -y && \ + dnf install -y podman buildah && \ + dnf clean all -y + +COPY configure-podman /root +RUN /root/configure-podman diff --git a/configure-podman b/configure-podman new file mode 100755 index 0000000..5071d28 --- /dev/null +++ b/configure-podman @@ -0,0 +1,13 @@ +#!/bin/sh +# +# need to tweak some config options so "podman build" can run inside a container +# + +# storage: can't use overlay (can't be stacked). +sed -i.orig -e '/^driver/s/overlay/vfs/' /etc/containers/storage.conf +diff -u /etc/containers/storage.conf.orig /etc/containers/storage.conf + +# cgroups: no systemd, so use cgroupfs directly +cp /usr/share/containers/libpod.conf /etc/containers +sed -i.orig -e '/^cgroup_manager/s/systemd/cgroupfs/' /etc/containers/libpod.conf +diff -u /etc/containers/libpod.conf.orig /etc/containers/libpod.conf |