mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-13 22:39:39 +00:00
Since we are building containerd v1.1.0 with go 1.10 (as it requires) to the same for init and runc too for consistency. In the case of init it is actually required since we use the containerd client library there. The subreaper interfaces have been removed from containerd and replaced with a similar interface in runc/libcontainer, update init to use that now. Signed-off-by: Ian Campbell <ijc@docker.com>
34 lines
1.1 KiB
Docker
34 lines
1.1 KiB
Docker
FROM linuxkit/alpine:02d7e748614512ea099e8c76254e41bcea03ba8f as alpine
|
|
# containerd v1.1.x requires go1.10 which is currently a separate package in Alpine 3.7
|
|
# Use the same version of go for consistency.
|
|
RUN \
|
|
apk add \
|
|
bash \
|
|
gcc \
|
|
git \
|
|
go1.10 \
|
|
libc-dev \
|
|
libseccomp-dev \
|
|
linux-headers \
|
|
make \
|
|
&& true
|
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
|
ENV RUNC_COMMIT=69663f0bd4b60df09991c08812a60108003fa340
|
|
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/
|
|
|
|
RUN mkdir -p /etc/init.d && ln -s /usr/bin/service /etc/init.d/010-onboot
|
|
RUN mkdir -p /etc/shutdown.d && ln -s /usr/bin/service /etc/shutdown.d/010-onshutdown
|
|
|
|
FROM scratch
|
|
WORKDIR /
|
|
ENTRYPOINT []
|
|
COPY --from=alpine /usr/bin/runc /usr/bin/
|
|
COPY --from=alpine /etc/init.d/ /etc/init.d/
|
|
COPY --from=alpine /etc/shutdown.d/ /etc/shutdown.d/
|