From e8e28c27e9e2309cdff7756e569383f8ace3cb46 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Tue, 17 Apr 2018 16:30:31 +0100 Subject: [PATCH] Bump packages to new alpine w/ containerd v1.1.0-rc.2 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 --- pkg/containerd/Dockerfile | 2 +- pkg/init/Dockerfile | 9 ++++++--- pkg/init/cmd/service/runc.go | 4 ++-- pkg/runc/Dockerfile | 6 ++++-- test/pkg/containerd/Dockerfile | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pkg/containerd/Dockerfile b/pkg/containerd/Dockerfile index 6590e3e6b..b08ba496e 100644 --- a/pkg/containerd/Dockerfile +++ b/pkg/containerd/Dockerfile @@ -1,4 +1,4 @@ -FROM linuxkit/alpine:f3cd219615428b2bd943411723eb28875275fae7 as alpine +FROM linuxkit/alpine:02d7e748614512ea099e8c76254e41bcea03ba8f as alpine RUN apk add tzdata WORKDIR $GOPATH/src/github.com/containerd/containerd diff --git a/pkg/init/Dockerfile b/pkg/init/Dockerfile index 4ca7a9f51..deedda510 100644 --- a/pkg/init/Dockerfile +++ b/pkg/init/Dockerfile @@ -1,10 +1,13 @@ -FROM linuxkit/alpine:f3cd219615428b2bd943411723eb28875275fae7 AS build +FROM linuxkit/alpine:02d7e748614512ea099e8c76254e41bcea03ba8f 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 -RUN apk add --no-cache go musl-dev +# 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 @@ -16,7 +19,7 @@ RUN mkdir /tmp/bin && cd /tmp/bin/ && cp /go/bin/rc.init . && ln -s rc.init rc.s 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:f3cd219615428b2bd943411723eb28875275fae7 AS mirror +FROM linuxkit/alpine:02d7e748614512ea099e8c76254e41bcea03ba8f 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 diff --git a/pkg/init/cmd/service/runc.go b/pkg/init/cmd/service/runc.go index ba242129f..97f8d704f 100644 --- a/pkg/init/cmd/service/runc.go +++ b/pkg/init/cmd/service/runc.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strconv" - "github.com/containerd/containerd/sys" + "github.com/opencontainers/runc/libcontainer/system" log "github.com/sirupsen/logrus" ) @@ -49,7 +49,7 @@ func runcInit(rootPath, serviceType string) int { } // need to set ourselves as a child subreaper or we cannot wait for runc as reparents to init - if err := sys.SetSubreaper(1); err != nil { + if err := system.SetSubreaper(1); err != nil { log.Fatalf("Cannot set as subreaper: %v", err) } diff --git a/pkg/runc/Dockerfile b/pkg/runc/Dockerfile index 3b8228473..c2c24cac2 100644 --- a/pkg/runc/Dockerfile +++ b/pkg/runc/Dockerfile @@ -1,10 +1,12 @@ -FROM linuxkit/alpine:f3cd219615428b2bd943411723eb28875275fae7 as alpine +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 \ - go \ + go1.10 \ libc-dev \ libseccomp-dev \ linux-headers \ diff --git a/test/pkg/containerd/Dockerfile b/test/pkg/containerd/Dockerfile index b5c384ffc..c97116ae0 100644 --- a/test/pkg/containerd/Dockerfile +++ b/test/pkg/containerd/Dockerfile @@ -1,4 +1,4 @@ -FROM linuxkit/alpine:f3cd219615428b2bd943411723eb28875275fae7 AS mirror +FROM linuxkit/alpine:02d7e748614512ea099e8c76254e41bcea03ba8f AS mirror RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/ # btrfs-progfs is required for btrfs test (mkfs.btrfs) # util-linux is required for btrfs test (losetup)