From 0afdd63412d41b3c48002121e4fdd5beb13811ee Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 22 Feb 2020 18:43:54 +0100 Subject: [PATCH 1/6] Dockerfile: use build-args to allow overriding versions Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c654705e75..0a82afbe79e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ -FROM golang:1.12-stretch +ARG GO_VERSION=1.12.17 +ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f +ARG CRIU_VERSION=v3.12 + +FROM golang:${GO_VERSION}-stretch RUN dpkg --add-architecture armel \ && dpkg --add-architecture armhf \ @@ -37,15 +41,16 @@ RUN dpkg --add-architecture armel \ RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless # install bats +ARG BATS_VERSION RUN cd /tmp \ && git clone https://github.com/sstephenson/bats.git \ && cd bats \ - && git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \ + && git reset --hard "${BATS_VERSION}" \ && ./install.sh /usr/local \ && rm -rf /tmp/bats # install criu -ENV CRIU_VERSION v3.12 +ARG CRIU_VERSION RUN mkdir -p /usr/src/criu \ && curl -sSL https://github.com/checkpoint-restore/criu/archive/${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 \ && cd /usr/src/criu \ From 97ae4e668a397d5837fd9f22e6d4afd74465c4dd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 22 Feb 2020 18:44:49 +0100 Subject: [PATCH 2/6] Dockerfile: set DEBIAN_FRONTEND=noninteractive Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0a82afbe79e..2b09620d2e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ ARG GO_VERSION=1.12.17 ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f ARG CRIU_VERSION=v3.12 +ARG DEBIAN_FRONTEND=noninteractive FROM golang:${GO_VERSION}-stretch +ARG DEBIAN_FRONTEND RUN dpkg --add-architecture armel \ && dpkg --add-architecture armhf \ From 01663d36f7f010b922cf0927b0e9a143414d084d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 23 Feb 2020 01:01:29 +0100 Subject: [PATCH 3/6] Dockerfile: sort dependencies, and cleanup apt cache Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 59 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b09620d2e1..1922699d586 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,32 +9,39 @@ ARG DEBIAN_FRONTEND RUN dpkg --add-architecture armel \ && dpkg --add-architecture armhf \ && dpkg --add-architecture arm64 \ - && dpkg --add-architecture ppc64el \ - && apt-get update && apt-get install -y \ - build-essential \ - curl \ - sudo \ - gawk \ - iptables \ - jq \ - pkg-config \ - libaio-dev \ - libcap-dev \ - libprotobuf-dev \ - libprotobuf-c0-dev \ - libnl-3-dev \ - libnet-dev \ - libseccomp2 \ - libseccomp-dev \ - protobuf-c-compiler \ - protobuf-compiler \ - python-minimal \ - uidmap \ - kmod \ - crossbuild-essential-armel crossbuild-essential-armhf crossbuild-essential-arm64 crossbuild-essential-ppc64el \ - libseccomp-dev:armel libseccomp-dev:armhf libseccomp-dev:arm64 libseccomp-dev:ppc64el \ - --no-install-recommends \ - && apt-get clean + && dpkg --add-architecture ppc64el + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + crossbuild-essential-arm64 \ + crossbuild-essential-armel \ + crossbuild-essential-armhf \ + crossbuild-essential-ppc64el \ + curl \ + gawk \ + iptables \ + jq \ + kmod \ + libaio-dev \ + libcap-dev \ + libnet-dev \ + libnl-3-dev \ + libprotobuf-c0-dev \ + libprotobuf-dev \ + libseccomp-dev \ + libseccomp-dev:arm64 \ + libseccomp-dev:armel \ + libseccomp-dev:armhf \ + libseccomp-dev:ppc64el \ + libseccomp2 \ + pkg-config \ + protobuf-c-compiler \ + protobuf-compiler \ + python-minimal \ + sudo \ + uidmap \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*; # Add a dummy user for the rootless integration tests. While runC does # not require an entry in /etc/passwd to operate, one of the tests uses From 89c2aa1cae7713dcad83ad748314f653151c39f8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 23 Feb 2020 01:09:59 +0100 Subject: [PATCH 4/6] Dockerfile: prevent busting build-cache for busybox rootfs Move adding the source code to the end, so that the busybox rootfs doesn't have to be fetched again on each code change. Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1922699d586..4db6fd4b538 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,15 +66,15 @@ RUN mkdir -p /usr/src/criu \ && make install-criu \ && rm -rf /usr/src/criu -# setup a playground for us to spawn containers in -ENV ROOTFS /busybox -RUN mkdir -p ${ROOTFS} - COPY script/tmpmount / WORKDIR /go/src/github.com/opencontainers/runc ENTRYPOINT ["/tmpmount"] -ADD . /go/src/github.com/opencontainers/runc - +# setup a playground for us to spawn containers in +COPY tests/integration/multi-arch.bash tests/integration/ +ENV ROOTFS /busybox +RUN mkdir -p ${ROOTFS} RUN . tests/integration/multi-arch.bash \ && curl -o- -sSL `get_busybox` | tar xfJC - ${ROOTFS} + +COPY . . From 93e7d783c63823e491966c61e0a7ace363093a80 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 23 Feb 2020 21:42:55 +0100 Subject: [PATCH 5/6] Dockerfile: switch to "buster" variant (current stable) Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4db6fd4b538..b9ff4c6fcb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f ARG CRIU_VERSION=v3.12 ARG DEBIAN_FRONTEND=noninteractive -FROM golang:${GO_VERSION}-stretch +FROM golang:${GO_VERSION}-buster ARG DEBIAN_FRONTEND RUN dpkg --add-architecture armel \ @@ -26,7 +26,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libcap-dev \ libnet-dev \ libnl-3-dev \ - libprotobuf-c0-dev \ + libprotobuf-c-dev \ libprotobuf-dev \ libseccomp-dev \ libseccomp-dev:arm64 \ From 6217cf34522736e75d4f1fb2ab60a4542044b8fb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 28 Feb 2020 16:08:16 +0100 Subject: [PATCH 6/6] Update Golang 1.13.8, start testing on Go 1.14 Signed-off-by: Sebastiaan van Stijn --- .travis.yml | 8 ++++---- Dockerfile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c2928df25c..ada62e75650 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,19 @@ dist: bionic language: go go: - - 1.11.x - - 1.12.x + - 1.13.x + - 1.14.x - tip matrix: include: - - go: 1.12.x + - go: 1.13.x env: - RUNC_USE_SYSTEMD=1 script: - make BUILDTAGS="${BUILDTAGS}" all - sudo PATH="$PATH" make localintegration RUNC_USE_SYSTEMD=1 - - go: 1.12.x + - go: 1.13.x env: - VIRTUALBOX_VERSION=6.0 - VAGRANT_VERSION=2.2.6 diff --git a/Dockerfile b/Dockerfile index b9ff4c6fcb0..c849160730e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.12.17 +ARG GO_VERSION=1.13.8 ARG BATS_VERSION=03608115df2071fff4eaaff1605768c275e5f81f ARG CRIU_VERSION=v3.12 ARG DEBIAN_FRONTEND=noninteractive