mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-04 09:35:12 +00:00
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:
@@ -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/
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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"]}'
|
||||
|
||||
@@ -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"]}'
|
||||
|
||||
Reference in New Issue
Block a user