mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 02:13:29 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
| FROM linuxkit/alpine:5ac048802293564a50414394e1b9896eac528e7d as builder
 | |
| 
 | |
| 
 | |
| # checkout and compile containerd
 | |
| # Update `FROM` in `pkg/containerd/Dockerfile`, `pkg/init/Dockerfile` and
 | |
| # `test/pkg/containerd/Dockerfile` when changing this.
 | |
| ENV CONTAINERD_REPO=https://github.com/containerd/containerd.git
 | |
| 
 | |
| ENV CONTAINERD_COMMIT=v1.7.20
 | |
| ENV GOPATH=/go
 | |
| RUN apk add go git
 | |
| RUN mkdir -p $GOPATH/src/github.com/containerd && \
 | |
|   cd $GOPATH/src/github.com/containerd && \
 | |
|   git clone https://github.com/containerd/containerd.git && \
 | |
|   cd $GOPATH/src/github.com/containerd/containerd && \
 | |
|   git checkout $CONTAINERD_COMMIT
 | |
| RUN apk add --no-cache btrfs-progs-dev gcc libc-dev linux-headers make libseccomp-dev
 | |
| WORKDIR $GOPATH/src/github.com/containerd/containerd
 | |
| RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
 | |
| 
 | |
| RUN cp bin/containerd bin/ctr bin/containerd-shim bin/containerd-shim-runc-v2 /usr/bin/
 | |
| RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2
 | |
| 
 | |
| FROM scratch
 | |
| ENTRYPOINT []
 | |
| WORKDIR /
 | |
| COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2 /usr/bin/
 | |
| COPY --from=builder /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd
 |