Merge pull request #51640 from AkihiroSuda/rm-dockerfile-install

rm -r hack/dockerfile/install
This commit is contained in:
Sebastiaan van Stijn
2025-12-11 21:08:15 +01:00
committed by GitHub
9 changed files with 21 additions and 188 deletions

View File

@@ -321,7 +321,6 @@ FROM tini-${TARGETOS} AS tini
FROM base AS rootlesskit-src
WORKDIR /usr/src/rootlesskit
RUN git init . && git remote add origin "https://github.com/rootless-containers/rootlesskit.git"
# When updating, also update go.mod and hack/dockerfile/install/rootlesskit.installer accordingly.
ARG ROOTLESSKIT_VERSION=v2.3.5
RUN git fetch -q --depth 1 origin "${ROOTLESSKIT_VERSION}" +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD

View File

@@ -34,12 +34,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
vim-common \
&& rm -rf /var/lib/apt/lists/*
# Install runc, containerd, and tini
# Please edit hack/dockerfile/install/<name>.installer to update them.
COPY hack/dockerfile/install hack/dockerfile/install
RUN set -e; for i in runc containerd tini dockercli; \
do hack/dockerfile/install/install.sh $i; \
done
# Install containerd.io (includes runc), tini, and docker-ce-cli.
# The versions of these dependencies differ from the main Dockerfile,
# but it should be sufficient for minimal build and test purposes.
ADD --chmod=0644 --checksum=sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570 \
https://download.docker.com/linux/debian/gpg /etc/apt/keyrings/docker.asc
ARG BASE_DEBIAN_DISTRO
ADD <<-EOT /etc/apt/sources.list.d/docker.sources
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: ${BASE_DEBIAN_DISTRO}
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOT
RUN apt-get update && apt-get install -y --no-install-recommends \
containerd.io \
tini \
docker-ce-cli \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/tini-static /usr/local/bin/docker-init
ENV PATH=/usr/local/cli:$PATH
ENV AUTO_GOPATH 1

View File

@@ -175,7 +175,7 @@ ARG CONTAINERD_VERSION=v2.0.7
# Environment variable notes:
# - GO_VERSION must be consistent with 'Dockerfile' used by Linux.
# - CONTAINERD_VERSION must be consistent with 'hack/dockerfile/install/containerd.installer' used by Linux.
# - CONTAINERD_VERSION must be consistent with 'Dockerfile' used by Linux.
# - FROM_DOCKERFILE is used for detection of building within a container.
ENV GO_VERSION=${GO_VERSION} `
CONTAINERD_VERSION=${CONTAINERD_VERSION} `

View File

@@ -1,36 +0,0 @@
#!/bin/sh
set -e
# CONTAINERD_VERSION specifies the version of the containerd runtime binary
# to install from the https://github.com/containerd/containerd repository.
#
# This version is used to build statically compiled containerd binaries, and
# used for the integration tests. The distributed docker .deb and .rpm packages
# depend on a separate (containerd.io) package, which may be a different version
# as is specified here.
#
# Generally, the commit specified here should match a tagged release.
: "${CONTAINERD_VERSION:=v2.2.0}"
install_containerd() (
echo "Install containerd version $CONTAINERD_VERSION"
git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd"
cd "$GOPATH/src/github.com/containerd/containerd"
git checkout -q "$CONTAINERD_VERSION"
export BUILDTAGS='netgo osusergo static_build'
export EXTRA_FLAGS=${GO_BUILDMODE}
export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"'
# Reset build flags to nothing if we want a dynbinary
if [ "$1" = "dynamic" ]; then
export BUILDTAGS=''
export EXTRA_FLAGS=''
export EXTRA_LDFLAGS=''
fi
make
install -D bin/containerd "${PREFIX}/containerd"
install -D bin/containerd-shim-runc-v2 "${PREFIX}/containerd-shim-runc-v2"
install -D bin/ctr "${PREFIX}/ctr"
)

View File

@@ -1,30 +0,0 @@
#!/bin/sh
: ${DOCKERCLI_CHANNEL:=stable}
: ${DOCKERCLI_VERSION:=18.06.3-ce}
install_dockercli() {
echo "Install docker/cli version $DOCKERCLI_VERSION from $DOCKERCLI_CHANNEL"
arch=$(uname -m)
# No official release of these platforms
if [ "$arch" != "x86_64" ] && [ "$arch" != "s390x" ] && [ "$arch" != "armhf" ]; then
build_dockercli
return
fi
url=https://download.docker.com/linux/static
curl -Ls "${url}/${DOCKERCLI_CHANNEL}/${arch}/docker-${DOCKERCLI_VERSION}.tgz" | tar -xz docker/docker
mkdir -p "${PREFIX}"
mv docker/docker "${PREFIX}/"
rmdir docker
}
build_dockercli() {
git clone https://github.com/docker/docker-ce "$GOPATH/tmp/docker-ce"
cd "$GOPATH/tmp/docker-ce"
git checkout -q "v$DOCKERCLI_VERSION"
mkdir -p "$GOPATH/src/github.com/docker"
mv components/cli "$GOPATH/src/github.com/docker/cli"
go build ${GO_BUILDMODE} -o "${PREFIX}/docker" "github.com/docker/cli/cmd/docker"
}

View File

@@ -1,39 +0,0 @@
#!/bin/bash
set -e
set -x
RM_GOPATH=0
TMP_GOPATH=${TMP_GOPATH:-""}
: ${PREFIX:="/usr/local/bin"}
if [ -z "$TMP_GOPATH" ]; then
export GOPATH="$(mktemp -d)"
RM_GOPATH=1
else
export GOPATH="$TMP_GOPATH"
fi
case "$(go env GOARCH)" in
mips* | ppc64)
# pie build mode is not supported on mips architectures
export GO_BUILDMODE=""
;;
*)
export GO_BUILDMODE="-buildmode=pie"
;;
esac
dir="$(dirname $0)"
bin=$1
shift
if [ ! -f "${dir}/${bin}.installer" ]; then
echo "Could not find installer for \"$bin\""
exit 1
fi
. ${dir}/${bin}.installer
install_${bin} "$@"

View File

@@ -1,31 +0,0 @@
#!/bin/sh
# When updating, also update go.mod and Dockerfile accordingly.
: "${ROOTLESSKIT_VERSION:=v2.3.5}"
install_rootlesskit() {
case "$1" in
"dynamic")
install_rootlesskit_dynamic
return
;;
"")
export CGO_ENABLED=0
_install_rootlesskit
;;
*)
echo 'Usage: $0 [dynamic]'
;;
esac
}
install_rootlesskit_dynamic() {
export ROOTLESSKIT_LDFLAGS="-linkmode=external" install_rootlesskit
export BUILD_MODE=${GO_BUILDMODE}
_install_rootlesskit
}
_install_rootlesskit() (
echo "Install rootlesskit version ${ROOTLESSKIT_VERSION}"
GOBIN="${PREFIX}" go install ${BUILD_MODE} -ldflags="$ROOTLESSKIT_LDFLAGS" "github.com/rootless-containers/rootlesskit/v2/cmd/rootlesskit@${ROOTLESSKIT_VERSION}"
)

View File

@@ -1,27 +0,0 @@
#!/bin/sh
set -e
# RUNC_VERSION specifies the version of runc to install from the
# https://github.com/opencontainers/runc repository.
#
# The version of runc should match the version that is used by the containerd
# version that is used. If you need to update runc, open a pull request in
# the containerd project first, and update both after that is merged.
: "${RUNC_VERSION:=v1.3.4}"
install_runc() {
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp"}"
echo "Install runc version $RUNC_VERSION (build tags: $RUNC_BUILDTAGS)"
git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
cd "$GOPATH/src/github.com/opencontainers/runc"
git checkout -q "$RUNC_VERSION"
if [ -z "$1" ]; then
target=static
else
target="$1"
fi
make BUILDTAGS="$RUNC_BUILDTAGS" "$target"
mkdir -p "${PREFIX}"
cp runc "${PREFIX}/runc"
}

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# TINI_VERSION specifies the version of tini (docker-init) to build, and install
# from the https://github.com/krallin/tini repository. This binary is used
# when starting containers with the `--init` option.
: "${TINI_VERSION:=v0.19.0}"
install_tini() {
echo "Install tini version $TINI_VERSION"
git clone https://github.com/krallin/tini.git "$GOPATH/tini"
cd "$GOPATH/tini"
git checkout -q "$TINI_VERSION"
cmake .
make tini-static
mkdir -p "${PREFIX}"
cp tini-static "${PREFIX}/docker-init"
}