diff --git a/Dockerfile b/Dockerfile index 87a22ac..fce9250 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,9 @@ FROM ${BASE_IMAGE}:${ALPINE_VERSION} MAINTAINER "f " COPY ./build.sh /usr/local/bin/build -RUN chmod 755 /usr/local/bin/build +COPY ./entrypoint.sh /usr/local/bin/entrypoint RUN echo "${ALPINE_VERSION}" | cut -d . -f 1,2 | xargs -I {} echo 'https://alpine.sutty.nl/alpine/v{}/sutty' >> /etc/apk/repositories RUN wget https://alpine.sutty.nl/alpine/sutty.pub -O /etc/apk/keys/alpine@sutty.nl-5ea884cd.rsa.pub -# We need to update to the builder has access to installing packages -RUN apk update RUN sed -re "s|https://dl-cdn.alpinelinux.org|http://alpine.proxy|g" -i /etc/apk/repositories -USER builder -ENTRYPOINT ["/usr/local/bin/build"] -CMD ["abuild", "-r"] +ENTRYPOINT ["/usr/local/bin/entrypoint"] diff --git a/build.sh b/build.sh index bcc8cef..41f87b7 100755 --- a/build.sh +++ b/build.sh @@ -6,5 +6,4 @@ export PATH=/usr/lib/ccache/bin:$PATH cd /home/builder/package abuild checksum - -exec $* +abuild -r diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..e36a242 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +apk update +su -c /usr/local/bin/build builder