mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-14 14:21:03 +00:00
Rewrite /init in Go
This uses a more memory efficient copy, and gets us closer to not having a shell in the base system if not required. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -4,6 +4,13 @@ RUN apk add --no-cache --initdb alpine-baselayout make gcc musl-dev
|
||||
ADD usermode-helper.c .
|
||||
RUN make usermode-helper
|
||||
|
||||
RUN apk add --no-cache go musl-dev
|
||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||
|
||||
COPY init.go /go/src/init/
|
||||
COPY vendor /go/src/init/vendor/
|
||||
RUN go-compile.sh /go/src/init/
|
||||
|
||||
FROM linuxkit/alpine:9bcf61f605ef0ce36cc94d59b8eac307862de6e1 AS mirror
|
||||
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
||||
RUN apk add --no-cache --initdb -p /out alpine-baselayout busybox musl
|
||||
@@ -15,8 +22,8 @@ FROM scratch
|
||||
ENTRYPOINT []
|
||||
CMD []
|
||||
WORKDIR /
|
||||
COPY --from=build /go/bin/init /
|
||||
COPY --from=build usermode-helper /sbin/
|
||||
COPY --from=mirror /out/ /
|
||||
COPY init /
|
||||
COPY etc etc/
|
||||
COPY bin bin/
|
||||
|
||||
Reference in New Issue
Block a user