From aae4d086c9595f81c91b983156e374038e8517fb Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Thu, 17 Mar 2016 12:22:21 -0700 Subject: [PATCH 1/2] Update to docker-from-scratch-v1.10.3 DFS-1.10.3 supports SELinux --- .drone.yml | 2 +- build.conf | 2 +- build.conf.amd64 | 2 +- build.conf.arm | 2 +- build.conf.arm64 | 2 +- trash.yml | 2 +- .../rancher/docker-from-scratch/.drone.yml | 2 +- .../docker-from-scratch/Dockerfile.dapper | 31 ++++++++++--------- .../selinux/selinux_arm.go | 6 ---- .../selinux/selinux_arm64.go | 6 ---- .../{selinux_amd64.go => selinux_linux.go} | 0 11 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm.go delete mode 100644 vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm64.go rename vendor/github.com/rancher/docker-from-scratch/selinux/{selinux_amd64.go => selinux_linux.go} (100%) diff --git a/.drone.yml b/.drone.yml index 9a7fbf66..7b616e71 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,5 +1,5 @@ build: - image: rancher/dapper:1.10.2 + image: rancher/dapper:1.10.3 volumes: - /var/run/docker.sock:/var/run/docker.sock commands: diff --git a/build.conf b/build.conf index e4b2b201..dc0ee550 100644 --- a/build.conf +++ b/build.conf @@ -1,6 +1,6 @@ IMAGE_NAME=rancher/os VERSION=v0.4.4-dev -DFS_IMAGE=rancher/docker:v1.10.2-1 +DFS_IMAGE=rancher/docker:v1.10.3 SELINUX_POLICY_URL=https://github.com/rancher/refpolicy/releases/download/v0.0.1/policy.29 HOSTNAME_DEFAULT=rancher diff --git a/build.conf.amd64 b/build.conf.amd64 index 79fa82e1..545b752b 100644 --- a/build.conf.amd64 +++ b/build.conf.amd64 @@ -2,4 +2,4 @@ DAPPER_BASE=ubuntu:16.04 TOOLCHAIN= #empty COMPILED_KERNEL_URL=https://github.com/rancher/os-kernel/releases/download/Ubuntu-4.2.0-28.33-rancher/linux-4.2.8-ckt3-rancher-x86.tar.gz -DOCKER_BINARY_URL=https://get.docker.com/builds/Linux/x86_64/docker-1.10.2 +DOCKER_BINARY_URL=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 diff --git a/build.conf.arm b/build.conf.arm index 78e541b7..9beea19a 100644 --- a/build.conf.arm +++ b/build.conf.arm @@ -2,4 +2,4 @@ DAPPER_BASE=armhf/ubuntu:16.04 TOOLCHAIN=arm-linux-gnueabihf COMPILED_KERNEL_URL= #empty -DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.2-arm2/docker-1.10.2_arm +DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm diff --git a/build.conf.arm64 b/build.conf.arm64 index 91c1b15d..0606ffc3 100644 --- a/build.conf.arm64 +++ b/build.conf.arm64 @@ -2,4 +2,4 @@ DAPPER_BASE=aarch64/ubuntu:16.04 TOOLCHAIN=aarch64-linux-gnu COMPILED_KERNEL_URL=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.1.18-arm64/linux-4.1.18-arm64.tar.gz -DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.2-arm2/docker-1.10.2_arm64 +DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm64 diff --git a/trash.yml b/trash.yml index 3c86dc90..d1e11c31 100644 --- a/trash.yml +++ b/trash.yml @@ -66,7 +66,7 @@ import: version: 1349b37bd56f4f5ce2690b5b2c0f53f88a261c67 - package: github.com/rancher/docker-from-scratch - version: v1.10.2-1 + version: v1.10.3 - package: github.com/rancher/netconf version: d7d620ef4ea62a9d04b51c7b3d9dc83fe7ffaa1b diff --git a/vendor/github.com/rancher/docker-from-scratch/.drone.yml b/vendor/github.com/rancher/docker-from-scratch/.drone.yml index 6ddc20a4..4cf357c3 100644 --- a/vendor/github.com/rancher/docker-from-scratch/.drone.yml +++ b/vendor/github.com/rancher/docker-from-scratch/.drone.yml @@ -1,5 +1,5 @@ build: - image: rancher/dapper:1.10.2 + image: rancher/dapper:1.10.3 volumes: - /var/run/docker.sock:/var/run/docker.sock commands: diff --git a/vendor/github.com/rancher/docker-from-scratch/Dockerfile.dapper b/vendor/github.com/rancher/docker-from-scratch/Dockerfile.dapper index b5648a92..e2d5afcd 100644 --- a/vendor/github.com/rancher/docker-from-scratch/Dockerfile.dapper +++ b/vendor/github.com/rancher/docker-from-scratch/Dockerfile.dapper @@ -1,16 +1,23 @@ -FROM golang:1.6 +FROM ubuntu:16.04 -RUN apt-get update && apt-get -y install libselinux-dev pkg-config -RUN wget -O /usr/local/bin/docker -L https://get.docker.com/builds/Linux/x86_64/docker-1.10.2 && \ +RUN apt-get update && \ + apt-get -y install locales sudo vim less curl wget git rsync build-essential isolinux xorriso gccgo \ + libblkid-dev libmount-dev libselinux1-dev cpio genisoimage qemu-kvm python-pip ca-certificates pkg-config tox + +RUN wget -O - https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz | tar -xz -C /usr/local +RUN wget -O /usr/local/bin/docker -L https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 && \ chmod +x /usr/local/bin/docker +ENV PATH /usr/local/go/bin:$PATH +RUN mkdir -p /go/src /go/bin && chmod -R 777 /go +ENV GOPATH /go +ENV PATH /go/bin:$PATH + ENV DAPPER_SOURCE /go/src/github.com/rancher/docker-from-scratch ENV DAPPER_OUTPUT "" ENV DAPPER_DOCKER_SOCKET true ENV DAPPER_ENV NO_TEST ARCH -ENV GO15VENDOREXPERIMENT 1 - RUN mkdir -p ${DAPPER_SOURCE} && ln -s ${DAPPER_SOURCE} /source WORKDIR ${DAPPER_SOURCE} @@ -22,20 +29,16 @@ RUN wget https://github.com/rancher/docker-from-scratch/releases/download/bin-v0 RUN wget https://github.com/rancher/docker-from-scratch/releases/download/bin-v0.4.0/base-files_arm.tar.gz RUN wget https://github.com/rancher/docker-from-scratch/releases/download/bin-v0.4.0/base-files_arm64.tar.gz -RUN wget -O ./docker_amd64 -L https://get.docker.com/builds/Linux/x86_64/docker-1.10.2 && \ +RUN wget -O ./docker_amd64 -L https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 && \ chmod +x ./docker_amd64 -RUN wget -O ./docker_arm -L https://github.com/rancher/docker/releases/download/v1.10.2-arm2/docker-1.10.2_arm && \ +RUN wget -O ./docker_arm -L https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm && \ chmod +x ./docker_arm -RUN wget -O ./docker_arm64 -L https://github.com/rancher/docker/releases/download/v1.10.2-arm2/docker-1.10.2_arm64 && \ +RUN wget -O ./docker_arm64 -L https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm64 && \ chmod +x ./docker_arm64 WORKDIR ${DAPPER_SOURCE} -COPY ./scripts/crosstools.list /etc/apt/sources.list.d/ - -RUN sh -c 'curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -' && \ - dpkg --add-architecture armhf && dpkg --add-architecture arm64 && \ - apt-get update && \ - apt-get install -y crossbuild-essential-armhf crossbuild-essential-arm64 +COPY ./scripts/install-libs.sh /tmp/ +RUN /tmp/install-libs.sh CMD ./scripts/ci diff --git a/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm.go b/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm.go deleted file mode 100644 index 9e305b33..00000000 --- a/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm.go +++ /dev/null @@ -1,6 +0,0 @@ -package selinux - -// SetFileContext is a stub for SELinux support on ARM -func SetFileContext(path string, context string) (int, error) { - return 0, nil -} diff --git a/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm64.go b/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm64.go deleted file mode 100644 index 9e305b33..00000000 --- a/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_arm64.go +++ /dev/null @@ -1,6 +0,0 @@ -package selinux - -// SetFileContext is a stub for SELinux support on ARM -func SetFileContext(path string, context string) (int, error) { - return 0, nil -} diff --git a/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_amd64.go b/vendor/github.com/rancher/docker-from-scratch/selinux/selinux_linux.go similarity index 100% rename from vendor/github.com/rancher/docker-from-scratch/selinux/selinux_amd64.go rename to vendor/github.com/rancher/docker-from-scratch/selinux/selinux_linux.go From a8dfd7089e1422c6cb34c5604678021ad6c69bd0 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Wed, 16 Mar 2016 10:52:05 -0700 Subject: [PATCH 2/2] Support SELinux on arm/arm64 --- Dockerfile.dapper | 5 ++++- build.conf.arm | 2 +- build.conf.arm64 | 4 ++-- selinux/{selinux_linux_amd64.go => selinux_linux.go} | 0 selinux/selinux_linux_arm.go | 6 ------ selinux/selinux_linux_arm64.go | 6 ------ 6 files changed, 7 insertions(+), 16 deletions(-) rename selinux/{selinux_linux_amd64.go => selinux_linux.go} (100%) delete mode 100644 selinux/selinux_linux_arm.go delete mode 100644 selinux/selinux_linux_arm64.go diff --git a/Dockerfile.dapper b/Dockerfile.dapper index b24b5a00..2407fff6 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -40,7 +40,7 @@ RUN if [ "${TOOLCHAIN}" != "" ] && ! which ${TOOLCHAIN}-gcc; then \ RUN if [ "${TOOLCHAIN}" != "" ]; then \ cd /usr/local/src && \ - for i in libselinux pcre3 util-linux; do \ + for i in libselinux libsepol pcre3 util-linux; do \ apt-get build-dep -y $i && \ apt-get source -y $i \ ;done \ @@ -57,6 +57,9 @@ RUN if [ "${TOOLCHAIN}" != "" ]; then \ RUN if [ "${TOOLCHAIN}" != "" ]; then \ cd /usr/local/src/libselinux-* && \ CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ make CFLAGS=-Wall && \ + make PREFIX=/usr/${TOOLCHAIN} DESTDIR=/usr/${TOOLCHAIN} install && \ + cd /usr/local/src/libsepol-* && \ + CC=${TOOLCHAIN}-gcc CXX=${TOOLCHAIN}-g++ make CFLAGS=-Wall && \ make PREFIX=/usr/${TOOLCHAIN} DESTDIR=/usr/${TOOLCHAIN} install \ ;fi diff --git a/build.conf.arm b/build.conf.arm index 9beea19a..e5ad46f2 100644 --- a/build.conf.arm +++ b/build.conf.arm @@ -2,4 +2,4 @@ DAPPER_BASE=armhf/ubuntu:16.04 TOOLCHAIN=arm-linux-gnueabihf COMPILED_KERNEL_URL= #empty -DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm +DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm diff --git a/build.conf.arm64 b/build.conf.arm64 index 0606ffc3..e2374538 100644 --- a/build.conf.arm64 +++ b/build.conf.arm64 @@ -1,5 +1,5 @@ DAPPER_BASE=aarch64/ubuntu:16.04 TOOLCHAIN=aarch64-linux-gnu -COMPILED_KERNEL_URL=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.1.18-arm64/linux-4.1.18-arm64.tar.gz -DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-arm/docker-1.10.3_arm64 +COMPILED_KERNEL_URL=https://github.com/imikushin/os-kernel/releases/download/Estuary-4.1.18-arm64-3/linux-4.1.18-arm64.tar.gz +DOCKER_BINARY_URL=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm64 diff --git a/selinux/selinux_linux_amd64.go b/selinux/selinux_linux.go similarity index 100% rename from selinux/selinux_linux_amd64.go rename to selinux/selinux_linux.go diff --git a/selinux/selinux_linux_arm.go b/selinux/selinux_linux_arm.go deleted file mode 100644 index 045a89c7..00000000 --- a/selinux/selinux_linux_arm.go +++ /dev/null @@ -1,6 +0,0 @@ -package selinux - -// InitializeSelinux is a stub for SELinux support on ARM -func InitializeSelinux() (int, error) { - return 0, nil -} diff --git a/selinux/selinux_linux_arm64.go b/selinux/selinux_linux_arm64.go deleted file mode 100644 index ab4b38b0..00000000 --- a/selinux/selinux_linux_arm64.go +++ /dev/null @@ -1,6 +0,0 @@ -package selinux - -// InitializeSelinux is a stub for SELinux support on ARM64 -func InitializeSelinux() (int, error) { - return 0, nil -}