mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +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:
parent
ddb9efbffb
commit
b3db1a887c
@ -1,4 +1,4 @@
|
|||||||
FROM linuxkit/alpine:6832775a7e861ee2d7842e157688ece52d007142 as alpine
|
FROM linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956 as alpine
|
||||||
RUN \
|
RUN \
|
||||||
apk add \
|
apk add \
|
||||||
btrfs-progs-dev \
|
btrfs-progs-dev \
|
||||||
@ -18,7 +18,7 @@ RUN mkdir -p $GOPATH/src/github.com/containerd && \
|
|||||||
WORKDIR $GOPATH/src/github.com/containerd/containerd
|
WORKDIR $GOPATH/src/github.com/containerd/containerd
|
||||||
RUN git checkout $CONTAINERD_COMMIT
|
RUN git checkout $CONTAINERD_COMMIT
|
||||||
RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS="-extldflags \\\"-fno-PIC -static\\\""
|
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
|
ADD cmd /go/src/cmd
|
||||||
RUN cd /go/src/cmd/service && ./skanky-vendor.sh $GOPATH/src/github.com/containerd/containerd
|
RUN cd /go/src/cmd/service && ./skanky-vendor.sh $GOPATH/src/github.com/containerd/containerd
|
||||||
@ -30,7 +30,7 @@ COPY . .
|
|||||||
FROM scratch
|
FROM scratch
|
||||||
ENTRYPOINT []
|
ENTRYPOINT []
|
||||||
WORKDIR /
|
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 /etc/containerd/config.toml /etc/containerd/
|
||||||
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
|
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
|
||||||
COPY etc etc/
|
COPY etc etc/
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
@ -17,7 +18,7 @@ import (
|
|||||||
func cleanupTask(ctx context.Context, ctr containerd.Container) error {
|
func cleanupTask(ctx context.Context, ctr containerd.Container) error {
|
||||||
task, err := ctr.Task(ctx, nil)
|
task, err := ctr.Task(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == containerd.ErrNoRunningTask {
|
if errdefs.IsNotFound(err) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.Wrap(err, "getting task")
|
return errors.Wrap(err, "getting task")
|
||||||
@ -36,7 +37,7 @@ func cleanupTask(ctx context.Context, ctr containerd.Container) error {
|
|||||||
}(deleteCtx, deleteErr)
|
}(deleteCtx, deleteErr)
|
||||||
|
|
||||||
sig := syscall.SIGKILL
|
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)
|
return errors.Wrapf(err, "killing task with %q", sig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,4 +29,4 @@ COPY --from=mirror /out/ /
|
|||||||
COPY usr/ /usr/
|
COPY usr/ /usr/
|
||||||
COPY etc/ /etc/
|
COPY etc/ /etc/
|
||||||
CMD ["/usr/bin/rungetty.sh"]
|
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/
|
COPY usr/ /usr/
|
||||||
RUN mkdir -p /etc/ssh /root/.ssh && chmod 0700 /root/.ssh
|
RUN mkdir -p /etc/ssh /root/.ssh && chmod 0700 /root/.ssh
|
||||||
CMD ["/sbin/tini", "/usr/bin/ssh.sh"]
|
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"]}'
|
||||||
|
@ -40,22 +40,22 @@ expect {
|
|||||||
|
|
||||||
expect {
|
expect {
|
||||||
timeout {
|
timeout {
|
||||||
puts "FAILED dist pull"
|
puts "FAILED ctr pull"
|
||||||
exec kill -9 $pid
|
exec kill -9 $pid
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
$prompt {
|
$prompt {
|
||||||
send "dist pull $image\n"
|
send "ctr pull $image\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expect {
|
expect {
|
||||||
timeout {
|
timeout {
|
||||||
puts "FAILED dist pull"
|
puts "FAILED ctr pull"
|
||||||
exec kill -9 $pid
|
exec kill -9 $pid
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
$prompt {
|
$prompt {
|
||||||
puts "SUCCESS dist pull"
|
puts "SUCCESS ctr pull"
|
||||||
send "ctr run -t $image test\n"
|
send "ctr run -t $image test\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,5 +50,6 @@ COPY --from=mirror /Dockerfile /Dockerfile
|
|||||||
|
|
||||||
RUN apk update && apk upgrade -a
|
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_REPO=https://github.com/ijc/containerd.git
|
||||||
ENV CONTAINERD_COMMIT=3455ffc08c553db0ca9fe60b4ba2b3e8a2dc960b
|
ENV CONTAINERD_COMMIT=d42cb88ba2b08d2ca6c8c017d629b394bf1dd08c
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# linuxkit/alpine:8130ebbcd8dd55e9a837067d1eb3884b2c72c5c3
|
# linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956
|
||||||
# automatically generated list of installed packages
|
# automatically generated list of installed packages
|
||||||
abuild-3.0.0_rc2-r8
|
abuild-3.0.0_rc2-r8
|
||||||
alpine-baselayout-3.0.4-r0
|
alpine-baselayout-3.0.4-r0
|
||||||
|
Loading…
Reference in New Issue
Block a user