Files
linuxkit/pkg/runc/Dockerfile
Justin Cormack 53d5ea42c4 Build runc as static pie
This was waiting on the runc update which added ability to add extra flags.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-07-14 15:38:32 +01:00

28 lines
743 B
Docker

FROM linuxkit/alpine:8bb8664eec04e02a8a131c53aa7d5d94119270ef as alpine
RUN \
apk add \
bash \
gcc \
git \
go \
libc-dev \
libseccomp-dev \
linux-headers \
make \
&& true
ENV GOPATH=/root/go
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/
FROM scratch
WORKDIR /
ENTRYPOINT []
COPY --from=alpine /usr/bin/runc /usr/bin/
COPY etc etc/