diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 2d3364e3d..57021db23 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -7,6 +7,11 @@ RUN \ adduser -D -H -s /sbin/nologin dockremap COPY . . +RUN cd /usr/bin && \ + ln -s docker-runc runc && \ + ln -s docker-containerd-shim containerd-shim && \ + ln -s docker-containerd-ctr containerd-ctr && \ + ln -s docker-containerd containerd RUN \ rc-update add sysctl boot && \ diff --git a/alpine/Makefile b/alpine/Makefile index 994bade55..716f7b9dc 100644 --- a/alpine/Makefile +++ b/alpine/Makefile @@ -45,7 +45,7 @@ moby.img: Dockerfile etc usr init -C packages/9pmount-vsock sbin -C ../.. \ -C packages/test etc -C ../.. \ -C packages/iptables usr -C ../.. \ - -C packages/containerd etc usr -C ../.. \ + -C packages/containerd etc -C ../.. \ -C packages/aws etc -C ../.. \ -C packages/azure etc -C ../.. \ -C packages/gcp etc -C ../.. \ diff --git a/alpine/packages/Makefile b/alpine/packages/Makefile index 89400c450..b2166e303 100644 --- a/alpine/packages/Makefile +++ b/alpine/packages/Makefile @@ -1,4 +1,4 @@ -DEPS=proxy diagnostics transfused tap-vsockd docker nc-vsock vsudd 9pmount-vsock iptables containerd +DEPS=proxy diagnostics transfused tap-vsockd docker nc-vsock vsudd 9pmount-vsock iptables .PHONY: clean $(DEPS) default: $(DEPS) diff --git a/alpine/packages/containerd/.gitignore b/alpine/packages/containerd/.gitignore deleted file mode 100644 index 73752c9ae..000000000 --- a/alpine/packages/containerd/.gitignore +++ /dev/null @@ -1 +0,0 @@ -usr diff --git a/alpine/packages/containerd/Makefile b/alpine/packages/containerd/Makefile deleted file mode 100644 index 25baf70a5..000000000 --- a/alpine/packages/containerd/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -CONTAINERD_IMAGE=mobylinux/containerd:cd9f1788bb2e8e7a342f32dd8ba70f450ff7ae2c@sha256:96a96f60751a1bb762e285f36e0cf9c5b4126933bb91475b7369efc990539165 -CONTAINERD_BINARIES=usr/bin/containerd usr/bin/containerd-shim usr/bin/ctr - -RUNC_IMAGE=mobylinux/runc:1a72d872ae97b90ae52482e4cb33a2778e168358@sha256:2ea83d68baa57d547ec6d407d09cd495e4ef9cd6b0207ec3525fb2752b4a197e -RUNC_BINARY=usr/bin/runc - -default: $(RUNC_BINARY) $(CONTAINERD_BINARIES) - -$(RUNC_BINARY): - mkdir -p $(dir $@) - docker run --rm --net=none $(RUNC_IMAGE) tar cf - $@ | tar xf - - -$(CONTAINERD_BINARIES): - mkdir -p $(dir $@) - docker run --rm --net=none $(CONTAINERD_IMAGE) tar cf - $@ | tar xf - - -clean: - rm -rf usr - -.DELETE_ON_ERROR: diff --git a/alpine/packages/containerd/etc/init.d/containerd b/alpine/packages/containerd/etc/init.d/containerd index 0b4aa225f..9f2fb9c4f 100755 --- a/alpine/packages/containerd/etc/init.d/containerd +++ b/alpine/packages/containerd/etc/init.d/containerd @@ -26,7 +26,7 @@ start() for f in /containers/* do - ctr run --bundle "$f" "$(basename $f)" 2>$LOG >$LOG & + containerd-ctr containers start --no-pivot --attach "$(basename $f)" "$f" 2>$LOG >$LOG & printf " $(basename $f)" done diff --git a/alpine/packages/diagnostics/usr/bin/diagnostics b/alpine/packages/diagnostics/usr/bin/diagnostics index eb137765d..c98c1a6a3 100755 --- a/alpine/packages/diagnostics/usr/bin/diagnostics +++ b/alpine/packages/diagnostics/usr/bin/diagnostics @@ -40,7 +40,7 @@ DIAGNOSTICS=$(ps -eo args | grep '^/usr/bin/diagnostics-server') [ $? -eq 0 ] && ok "Diagnostics server running: $DIAGNOSTICS\n" || fail "No diagnostics server\n" CONTAINERD=$(ps -eo args | grep '^/usr/bin/containerd') [ $? -eq 0 ] && ok "System containerd server running: $CONTAINERD\n" || fail "No containerd server\n" -CONTAINERPS=$(ctr list 2>&1) +CONTAINERPS=$(containerd-ctr containers 2>&1) [ $? -eq 0 ] && ok "System containerd working\n" || fail "containerd failed: $CONTAINERPS\n" exit $EXIT_STATUS diff --git a/alpine/packages/test/etc/init.d/test b/alpine/packages/test/etc/init.d/test index 09d560145..f0f5e4747 100755 --- a/alpine/packages/test/etc/init.d/test +++ b/alpine/packages/test/etc/init.d/test @@ -11,7 +11,7 @@ start() ebegin "Running tests" - if ctr run --bundle /test test + if containerd-ctr containers start --no-pivot --attach test /test then printf "Moby test suite PASSED\n" else diff --git a/base/containerd/Dockerfile b/base/containerd/Dockerfile deleted file mode 100644 index c4e0ce51e..000000000 --- a/base/containerd/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM golang:1.7-alpine3.5 -RUN \ - apk update && apk upgrade -a && \ - apk add --no-cache \ - gcc \ - git \ - libc-dev \ - make \ - && true -ENV CONTAINERD_COMMIT=3b79682548339895fcf9976f60ddea8abc5fc97e -RUN mkdir -p $GOPATH/src/github.com/docker && \ - cd $GOPATH/src/github.com/docker && \ - git clone https://github.com/docker/containerd.git -WORKDIR $GOPATH/src/github.com/docker/containerd -RUN git checkout $CONTAINERD_COMMIT -RUN make binaries GO_GCFLAGS="-buildmode pie --ldflags '-extldflags \"-fno-PIC -static\"'" -RUN cp bin/containerd bin/ctr bin/containerd-shim /usr/bin/ -WORKDIR / -COPY . . diff --git a/base/containerd/Makefile b/base/containerd/Makefile deleted file mode 100644 index 9dd2c5017..000000000 --- a/base/containerd/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -.PHONY: tag push - -BASE=golang:1.7-alpine3.5 -IMAGE=containerd - -default: push - -hash: Dockerfile - DOCKER_CONTENT_TRUST=1 docker pull $(BASE) - tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --rm $(IMAGE):build sh -c 'cat Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@ - -push: hash - docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ - (docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ - docker push mobylinux/$(IMAGE):$(shell cat hash)) - docker rmi $(IMAGE):build - rm -f hash - -tag: hash - docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ - docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) - docker rmi $(IMAGE):build - rm -f hash - -clean: - rm -f hash - -.DELETE_ON_ERROR: diff --git a/base/runc/Dockerfile b/base/runc/Dockerfile deleted file mode 100644 index 3a86c6574..000000000 --- a/base/runc/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM golang:1.7-alpine3.5 -RUN \ - apk update && apk upgrade -a && \ - apk add --no-cache \ - bash \ - gcc \ - git \ - libc-dev \ - libseccomp-dev \ - linux-headers \ - make \ - && true -ENV RUNC_COMMIT=51371867a01c467f08af739783b8beafc154c4d7 -RUN mkdir -p $GOPATH/src/github.com/opencontainers && \ - cd $GOPATH/src/github.com/opencontainers && \ - git clone https://github.com/opencontainers/runc.git -WORKDIR $GOPATH/src/github.com/opencontainers/runc -RUN git checkout $RUNC_COMMIT -# TODO static pie, currently no easy way to change build options -RUN make static BUILDTAGS="seccomp" -RUN cp runc /usr/bin/ -WORKDIR / -COPY . . diff --git a/base/runc/Makefile b/base/runc/Makefile deleted file mode 100644 index 27c740302..000000000 --- a/base/runc/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -.PHONY: tag push - -BASE=golang:1.7-alpine3.5 -IMAGE=runc - -default: push - -hash: Dockerfile - DOCKER_CONTENT_TRUST=1 docker pull $(BASE) - tar cf - $^ | docker build --no-cache -t $(IMAGE):build - - docker run --rm $(IMAGE):build sh -c 'cat Dockerfile /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > $@ - -push: hash - docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ - (docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \ - docker push mobylinux/$(IMAGE):$(shell cat hash)) - docker rmi $(IMAGE):build - rm -f hash - -tag: hash - docker pull mobylinux/$(IMAGE):$(shell cat hash) || \ - docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) - docker rmi $(IMAGE):build - rm -f hash - -clean: - rm -f hash - -.DELETE_ON_ERROR: diff --git a/docs/containerd.md b/docs/containerd.md index 21d4c021f..44544c8b3 100644 --- a/docs/containerd.md +++ b/docs/containerd.md @@ -19,8 +19,8 @@ docker rm ${CONTAINER} mkdir -p /var/log/nginx /var/cache/nginx -ctr run --bundle . ${NAME} -ctr list +containerd-ctr containers start ${NAME} . +containerd-ctr containers ``` For production, you will want to create the `config.json` offline and bundle it in with your