debian/Dockerfile

59 lines
1.7 KiB
Docker
Raw Permalink Normal View History

2020-05-28 11:02:04 +00:00
FROM debian:stable as builder
RUN set -xe;\
apt-get update &&\
apt-get install -y debootstrap &&\
2022-01-29 17:33:11 +00:00
mount &&\
2021-10-28 21:58:13 +00:00
debootstrap --include=apt,ca-certificates,curl --foreign --variant=minbase bullseye /dest &&\
2020-05-28 11:02:04 +00:00
sed -i 's/setup_proc//' /dest/debootstrap/suite-script
FROM scratch as bootstrapped
COPY --from=builder /dest /
RUN set -xe;\
/debootstrap/debootstrap --second-stage &&\
rm -rf /var/cache/apt/archives/* &&\
rm -rf /var/lib/apt/lists/*
FROM bootstrapped as toolbuilder
2021-10-28 22:18:51 +00:00
ENV GOSU_VERSION="1.14"
2022-01-29 17:33:11 +00:00
ENV SUEXEC_VERSION="0.2"
2021-02-03 11:41:18 +00:00
ENV DUMB_INIT_VERSION="1.2.5"
2020-05-28 11:02:04 +00:00
RUN set -xe;\
apt-get update &&\
apt-get install -y git golang &&\
git clone https://github.com/tianon/gosu.git /build &&\
cd /build &&\
git checkout $GOSU_VERSION &&\
2021-10-28 22:18:51 +00:00
go mod download &&\
go build
2020-05-28 11:02:04 +00:00
RUN set -xe;\
apt-get install -y build-essential &&\
cd / &&\
curl -LO https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz &&\
tar xvzf v${DUMB_INIT_VERSION}.tar.gz &&\
cd dumb-init-${DUMB_INIT_VERSION} &&\
make &&\
cp dumb-init /
2022-01-29 17:33:11 +00:00
RUN set -xe;\
apt-get install -y libc6-dev make gcc &&\
cd / &&\
curl -LO https://github.com/ncopa/su-exec/archive/refs/tags/v0.2.tar.gz &&\
tar xvaf v0.2.tar.gz &&\
cd su-exec-* &&\
make &&\
cp su-exec /
2020-05-28 11:02:04 +00:00
FROM bootstrapped
ARG DATE
2020-10-28 16:30:37 +00:00
ENV GOSU_VERSION="1.12"
2020-12-03 14:17:26 +00:00
ENV DUMB_INIT_VERSION="1.2.3"
2021-10-28 22:18:51 +00:00
COPY --from=toolbuilder /build/gosu /usr/local/sbin/gosu
2020-05-28 11:02:04 +00:00
COPY --from=toolbuilder /dumb-init /usr/local/sbin/dumb-init
2022-01-29 17:33:11 +00:00
COPY --from=toolbuilder /su-exec /usr/local/sbin/su-exec
2020-05-28 11:02:04 +00:00
COPY apt-install /bin/apt-install
2020-06-29 08:48:31 +00:00
COPY checkupdates /bin/checkupdates
2020-05-28 11:02:04 +00:00
CMD "bash"
2022-01-29 17:33:11 +00:00
LABEL version.debian=bullseye \
2020-05-28 11:02:04 +00:00
version.gosu=$GOSU_VERSION \
version.dumb-init=$DUMB_INIT_VERSION \
build.date=$DATE