mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-12 17:50:15 +00:00
At present they use a small shared function called "prepare" that does the read-write remounts, that I will switch to doing overlay mounts soon. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
34 lines
1.0 KiB
Docker
34 lines
1.0 KiB
Docker
FROM linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956 as alpine
|
|
RUN \
|
|
apk add \
|
|
bash \
|
|
gcc \
|
|
git \
|
|
go \
|
|
libc-dev \
|
|
libseccomp-dev \
|
|
linux-headers \
|
|
make \
|
|
&& true
|
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
|
ENV RUNC_COMMIT=429a5387123625040bacfbb60d96b1cbd02293ab
|
|
RUN mkdir -p $GOPATH/src/github.com/opencontainers && \
|
|
cd $GOPATH/src/github.com/opencontainers && \
|
|
git clone https://github.com/opencontainers/runc.git
|
|
WORKDIR $GOPATH/src/github.com/opencontainers/runc
|
|
RUN git checkout $RUNC_COMMIT
|
|
RUN make static BUILDTAGS="seccomp" EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS="-extldflags \\\"-fno-PIC -static\\\""
|
|
RUN cp runc /usr/bin/
|
|
|
|
ADD cmd /go/src/cmd
|
|
RUN go-compile.sh /go/src/cmd/onboot
|
|
RUN mkdir -p /etc/init.d && ln -s /usr/bin/onboot /etc/init.d/010-onboot
|
|
RUN mkdir -p /etc/shutdown.d && ln -s /usr/bin/onboot /etc/shutdown.d/010-onshutdown
|
|
|
|
FROM scratch
|
|
WORKDIR /
|
|
ENTRYPOINT []
|
|
COPY --from=alpine /usr/bin/runc /go/bin/onboot /usr/bin/
|
|
COPY --from=alpine /etc/init.d/ /etc/init.d/
|
|
COPY --from=alpine /etc/shutdown.d/ /etc/shutdown.d/
|