Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7a7d081
hack/make.ps1: know where we failed
kolyshkin Aug 28, 2018
8976590
Fix double slash after $PREFIX
thaJeztah Dec 24, 2018
b881d8f
Use 17.06 stable channel for CLI used in CI
thaJeztah Jan 13, 2019
2f1c29f
fix hack/dockerfile/install/containerd.installer test statement
gaorong Feb 26, 2019
8bb6de6
Support cross-compile for arm
cpuguy83 Apr 6, 2019
929337f
Fix DOCKER_CROSS being overwritten
thaJeztah Apr 13, 2019
bd11bc4
Add support for setting GOARM in cross target.
cpuguy83 Apr 16, 2019
899d9e2
Make CC toolchains available for other targets
cpuguy83 Apr 16, 2019
8f4ddc9
Set DOCKER_BINDDIR mount options from env
cpuguy83 Jun 3, 2019
caa11a4
Fix "Removing bundles/" not actually removing bundles
thaJeztah Jul 12, 2019
c8d69fa
TESTING.md: document GO_VERSION
kolyshkin Jul 18, 2019
c0fa7b6
added hack/ci/master as entry point for master codeline checks
andrewhsu Jul 20, 2019
2fe5b01
Add support for setting a test filter
cpuguy83 Aug 2, 2019
be340bc
Improve integration test detecetor
cpuguy83 Aug 7, 2019
b8ea2de
make.ps1: Run-IntegrationTests(): set working directory for test suite
thaJeztah Aug 8, 2019
6f7072d
Dockerfile: use --no-install-recommends for all stages
thaJeztah Jul 30, 2019
fdac9f8
Dockerfile: use DEBIAN_FRONTEND=noninteractive
thaJeztah Aug 11, 2019
00793f7
Jenkinsfile: run DCO check before everything else
thaJeztah Aug 11, 2019
45456b8
Dockerfile: add python3-wheel back again (for yamllint)
thaJeztah Aug 10, 2019
cae1999
Use new windows labels
StefanScherer Aug 14, 2019
2bc1ed3
hack/make.sh remove "latest" symlink
thaJeztah Aug 25, 2019
8c28fd6
Replace libprotobuf-c0-dev with libprotobuf-c-dev
thaJeztah Jul 17, 2019
944eca3
hack/make: fix some linting issues reported by shellcheck
thaJeztah Aug 24, 2019
835e926
Jenkinsfile: use wildcards for artifacts, and don't fail on missing ones
thaJeztah Aug 11, 2019
61ada8d
Jenkinsfile: don't mark build failed when failing to create bundles
thaJeztah Aug 24, 2019
344fd1e
Jenkinsfile: fix invalid expression in bundles script
thaJeztah Aug 28, 2019
6a15a81
windows.ps1: fix leaked NdisAdapters not being cleaned up on RS1
thaJeztah Aug 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 80 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,31 @@
# the case. Therefore, you don't have to disable it anymore.
#

ARG CROSS="false"
ARG GO_VERSION=1.11.13
ARG DEBIAN_FRONTEND=noninteractive

FROM golang:${GO_VERSION}-stretch AS base
ARG APT_MIRROR
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list

FROM base AS criu
ARG DEBIAN_FRONTEND
# Install CRIU for checkpoint/restore support
ENV CRIU_VERSION 3.6
# Install dependency packages specific to criu
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
libnet-dev \
libprotobuf-c0-dev \
libprotobuf-c-dev \
libprotobuf-dev \
libnl-3-dev \
libcap-dev \
protobuf-compiler \
protobuf-c-compiler \
python-protobuf \
&& mkdir -p /usr/src/criu \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/src/criu \
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
&& cd /usr/src/criu \
&& make \
Expand Down Expand Up @@ -83,7 +87,11 @@ RUN set -x \
&& rm -rf "$GOPATH"

FROM base AS frozen-images
RUN apt-get update && apt-get install -y jq ca-certificates --no-install-recommends
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
jq \
&& rm -rf /var/lib/apt/lists/*
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /
RUN /download-frozen-image-v2.sh /build \
Expand All @@ -94,73 +102,120 @@ RUN /download-frozen-image-v2.sh /build \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)

# Just a little hack so we don't have to install these deps twice, once for runc and once for dockerd
FROM base AS runtime-dev
RUN apt-get update && apt-get install -y \
FROM base AS cross-false

FROM base AS cross-true
ARG DEBIAN_FRONTEND
RUN dpkg --add-architecture armhf
RUN dpkg --add-architecture arm64
RUN dpkg --add-architecture armel
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
apt-get update && apt-get install -y --no-install-recommends \
crossbuild-essential-armhf \
crossbuild-essential-arm64 \
crossbuild-essential-armel \
&& rm -rf /var/lib/apt/lists/*; \
fi

FROM cross-${CROSS} as dev-base

FROM dev-base AS runtime-dev-cross-false
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends \
libapparmor-dev \
libseccomp-dev
libseccomp-dev \
&& rm -rf /var/lib/apt/lists/*
FROM cross-true AS runtime-dev-cross-true
ARG DEBIAN_FRONTEND
# These crossbuild packages rely on gcc-<arch>, but this doesn't want to install
# on non-amd64 systems.
# Additionally, the crossbuild-amd64 is currently only on debian:buster, so
# other architectures cannnot crossbuild amd64.
RUN if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
apt-get update && apt-get install -y --no-install-recommends \
libseccomp-dev:armhf \
libseccomp-dev:arm64 \
libseccomp-dev:armel \
libapparmor-dev:armhf \
libapparmor-dev:arm64 \
libapparmor-dev:armel \
# install this arches seccomp here due to compat issues with the v0 builder
# This is as opposed to inheriting from runtime-dev-cross-false
libapparmor-dev \
libseccomp-dev \
&& rm -rf /var/lib/apt/lists/*; \
fi

FROM runtime-dev-cross-${CROSS} AS runtime-dev

FROM base AS tomlv
ENV INSTALL_BINARY_NAME=tomlv
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS vndr
ENV INSTALL_BINARY_NAME=vndr
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS containerd
RUN apt-get update && apt-get install -y btrfs-tools
FROM dev-base AS containerd
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends \
btrfs-tools \
&& rm -rf /var/lib/apt/lists/*
ENV INSTALL_BINARY_NAME=containerd
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS proxy
FROM dev-base AS proxy
ENV INSTALL_BINARY_NAME=proxy
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS gometalinter
ENV INSTALL_BINARY_NAME=gometalinter
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS gotestsum
ENV INSTALL_BINARY_NAME=gotestsum
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS dockercli
FROM dev-base AS dockercli
ENV INSTALL_BINARY_NAME=dockercli
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM runtime-dev AS runc
ENV INSTALL_BINARY_NAME=runc
COPY hack/dockerfile/install/install.sh ./install.sh
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME

FROM base AS tini
RUN apt-get update && apt-get install -y cmake vim-common
FROM dev-base AS tini
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
vim-common \
&& rm -rf /var/lib/apt/lists/*
COPY hack/dockerfile/install/install.sh ./install.sh
ENV INSTALL_BINARY_NAME=tini
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
RUN PREFIX=/build/ ./install.sh $INSTALL_BINARY_NAME
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME



# TODO: Some of this is only really needed for testing, it would be nice to split this up
FROM runtime-dev AS dev
ARG DEBIAN_FRONTEND
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser
# Let us use a .bashrc file
Expand All @@ -171,7 +226,7 @@ RUN ln -s /usr/local/completion/bash/docker /etc/bash_completion.d/docker
RUN ldconfig
# This should only install packages that are specifically needed for the dev environment and nothing else
# Do you really need to add another package here? Can it be done in a different build stage?
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
apparmor \
aufs-tools \
bash-completion \
Expand All @@ -188,14 +243,15 @@ RUN apt-get update && apt-get install -y \
pigz \
python3-pip \
python3-setuptools \
python3-wheel \
thin-provisioning-tools \
vim \
vim-common \
xfsprogs \
zip \
bzip2 \
xz-utils \
--no-install-recommends
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install yamllint==1.16.0

Expand Down
Loading