Update to containerd v1.0.0-alpha1

This is actually containerd#1141 rebased onto v1.0.0-alpha1.

The `dist` command has been integreated into `ctr` and so is removed, including
from the getty and sshd bind mounts and the test which uses it is updated..

There is no change to the version of runc vendored by containerd, so this is
unchanged.

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell 2017-07-20 11:45:47 +01:00
parent ddb9efbffb
commit b3db1a887c
7 changed files with 15 additions and 13 deletions

View File

@ -1,4 +1,4 @@
FROM linuxkit/alpine:6832775a7e861ee2d7842e157688ece52d007142 as alpine
FROM linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956 as alpine
RUN \
apk add \
btrfs-progs-dev \
@ -18,7 +18,7 @@ RUN mkdir -p $GOPATH/src/github.com/containerd && \
WORKDIR $GOPATH/src/github.com/containerd/containerd
RUN git checkout $CONTAINERD_COMMIT
RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS="-extldflags \\\"-fno-PIC -static\\\""
RUN cp bin/containerd bin/ctr bin/containerd-shim bin/dist /usr/bin/
RUN cp bin/containerd bin/ctr bin/containerd-shim /usr/bin/
ADD cmd /go/src/cmd
RUN cd /go/src/cmd/service && ./skanky-vendor.sh $GOPATH/src/github.com/containerd/containerd
@ -30,7 +30,7 @@ COPY . .
FROM scratch
ENTRYPOINT []
WORKDIR /
COPY --from=alpine /usr/bin/containerd /usr/bin/ctr /usr/bin/dist /usr/bin/containerd-shim /go/bin/service /usr/bin/
COPY --from=alpine /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /go/bin/service /usr/bin/
COPY --from=alpine /etc/containerd/config.toml /etc/containerd/
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
COPY etc etc/

View File

@ -10,6 +10,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/namespaces"
"github.com/pkg/errors"
)
@ -17,7 +18,7 @@ import (
func cleanupTask(ctx context.Context, ctr containerd.Container) error {
task, err := ctr.Task(ctx, nil)
if err != nil {
if err == containerd.ErrNoRunningTask {
if errdefs.IsNotFound(err) {
return nil
}
return errors.Wrap(err, "getting task")
@ -36,7 +37,7 @@ func cleanupTask(ctx context.Context, ctr containerd.Container) error {
}(deleteCtx, deleteErr)
sig := syscall.SIGKILL
if err := task.Kill(ctx, sig); err != nil && err != containerd.ErrProcessExited {
if err := task.Kill(ctx, sig); err != nil && !errdefs.IsNotFound(err) {
return errors.Wrapf(err, "killing task with %q", sig)
}

View File

@ -29,4 +29,4 @@ COPY --from=mirror /out/ /
COPY usr/ /usr/
COPY etc/ /etc/
CMD ["/usr/bin/rungetty.sh"]
LABEL org.mobyproject.config='{"pid": "host", "net":"host", "binds": ["/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/usr/bin/dist:/usr/bin/dist", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}'
LABEL org.mobyproject.config='{"pid": "host", "net":"host", "binds": ["/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}'

View File

@ -20,4 +20,4 @@ COPY etc/ /etc/
COPY usr/ /usr/
RUN mkdir -p /etc/ssh /root/.ssh && chmod 0700 /root/.ssh
CMD ["/sbin/tini", "/usr/bin/ssh.sh"]
LABEL org.mobyproject.config='{"pid": "host", "binds": ["/root/.ssh:/root/.ssh", "/etc/resolv.conf:/etc/resolv.conf", "/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/usr/bin/dist:/usr/bin/dist", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}'
LABEL org.mobyproject.config='{"pid": "host", "binds": ["/root/.ssh:/root/.ssh", "/etc/resolv.conf:/etc/resolv.conf", "/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}'

View File

@ -40,22 +40,22 @@ expect {
expect {
timeout {
puts "FAILED dist pull"
puts "FAILED ctr pull"
exec kill -9 $pid
exit 1
}
$prompt {
send "dist pull $image\n"
send "ctr pull $image\n"
}
}
expect {
timeout {
puts "FAILED dist pull"
puts "FAILED ctr pull"
exec kill -9 $pid
exit 1
}
$prompt {
puts "SUCCESS dist pull"
puts "SUCCESS ctr pull"
send "ctr run -t $image test\n"
}
}

View File

@ -50,5 +50,6 @@ COPY --from=mirror /Dockerfile /Dockerfile
RUN apk update && apk upgrade -a
# v1.0.0-alpha1 plus https://github.com/containerd/containerd/pull/1141
ENV CONTAINERD_REPO=https://github.com/ijc/containerd.git
ENV CONTAINERD_COMMIT=3455ffc08c553db0ca9fe60b4ba2b3e8a2dc960b
ENV CONTAINERD_COMMIT=d42cb88ba2b08d2ca6c8c017d629b394bf1dd08c

View File

@ -1,4 +1,4 @@
# linuxkit/alpine:8130ebbcd8dd55e9a837067d1eb3884b2c72c5c3
# linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956
# automatically generated list of installed packages
abuild-3.0.0_rc2-r8
alpine-baselayout-3.0.4-r0