mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-11-04 02:32:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
FROM linuxkit/alpine:aacd96ba37a981d0ba659fd57316c7140cf59a36 AS build
 | 
						|
RUN apk add --no-cache --initdb alpine-baselayout make gcc musl-dev git linux-headers
 | 
						|
 | 
						|
ADD usermode-helper.c ./
 | 
						|
RUN LDFLAGS=-static CFLAGS=-Werror make usermode-helper
 | 
						|
 | 
						|
# containerd v1.1.x requires go1.10 which is currently a separate package in
 | 
						|
# Alpine 3.7 Use the same version here for consistency and because we use the
 | 
						|
# containerd client library.
 | 
						|
RUN apk add --no-cache go1.10 musl-dev
 | 
						|
ENV GOPATH=/go PATH=$PATH:/go/bin
 | 
						|
 | 
						|
COPY cmd /go/src/cmd
 | 
						|
RUN go-compile.sh /go/src/cmd/init
 | 
						|
RUN go-compile.sh /go/src/cmd/rc.init
 | 
						|
# this makes sure that the multi stage build copies as a symlink
 | 
						|
RUN mkdir /tmp/bin && cd /tmp/bin/ && cp /go/bin/rc.init . && ln -s rc.init rc.shutdown
 | 
						|
 | 
						|
RUN cd /go/src/cmd/service && ./skanky-vendor.sh $GOPATH/src/github.com/containerd/containerd
 | 
						|
RUN go-compile.sh /go/src/cmd/service
 | 
						|
 | 
						|
FROM linuxkit/alpine:aacd96ba37a981d0ba659fd57316c7140cf59a36 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
 | 
						|
 | 
						|
# Add /etc/ssl/certs so it can be bind-mounted into metadata package
 | 
						|
RUN mkdir -p /out/etc/ssl/certs
 | 
						|
 | 
						|
# Remove apk residuals. We have a read-only rootfs, so apk is of no use.
 | 
						|
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
 | 
						|
 | 
						|
FROM scratch
 | 
						|
ENTRYPOINT []
 | 
						|
CMD []
 | 
						|
WORKDIR /
 | 
						|
COPY --from=build /go/bin/init /
 | 
						|
COPY --from=build /tmp/bin /bin/
 | 
						|
COPY --from=build /go/bin/service /usr/bin/
 | 
						|
COPY --from=build usermode-helper /sbin/
 | 
						|
COPY --from=mirror /out/ /
 | 
						|
COPY etc etc/
 |