27 lines
972 B
Docker
27 lines
972 B
Docker
# Source for dockerfile:
|
|
# https://github.com/containers/buildah/blob/master/docs/tutorials/05-openshift-rootless-bud.md
|
|
FROM redhat/ubi8-minimal
|
|
|
|
RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
|
|
microdnf install buildah podman && \
|
|
microdnf clean all && \
|
|
useradd --no-log-init -r -u 1001150000 build && \
|
|
touch /etc/subgid /etc/subuid && \
|
|
chmod g=u /etc/subgid /etc/subuid /etc/passwd && \
|
|
echo build:1001150000:65536 > /etc/subuid && \
|
|
echo build:1001150000:65536 > /etc/subgid
|
|
|
|
# Use chroot since the default runc does not work when running rootless
|
|
RUN echo "export BUILDAH_ISOLATION=chroot" >> /home/build/.bashrc
|
|
|
|
# Use VFS since fuse does not work
|
|
RUN mkdir -p /home/build/.config/containers \
|
|
&& echo "driver=\"vfs\"" > /home/build/.config/containers/storage.conf
|
|
|
|
USER build
|
|
WORKDIR /home/build
|
|
|
|
# Add plugin binary
|
|
ADD release/linux/amd64/drone-docker /bin/
|
|
ENTRYPOINT ["/bin/drone-docker"]
|