move runc version to a separate file for easier consumption

This moves the runc version to build to scripts/setup/runc-version,
which makes it easier for packagers to find the default version
to use.

The RUNC_VERSION environment variable can still be used to override
the version, which can be used (e.g.) to test against different versions
in our CI.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-03-10 13:59:17 +01:00
parent 8325ba5d36
commit 79a51cd16a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 10 additions and 7 deletions

View File

@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y \
libseccomp-dev \ libseccomp-dev \
--no-install-recommends --no-install-recommends
COPY script/setup/install-runc install-runc COPY script/setup/runc-version script/setup/install-runc ./
# Allow overriding the version of runc to install through build-args # Allow overriding the version of runc to install through build-args
ARG RUNC_VERSION ARG RUNC_VERSION
ARG GOPROXY=direct ARG GOPROXY=direct

View File

@ -3,13 +3,13 @@ provided by [runc](https://github.com/opencontainers/runc).
Development (`-dev`) and pre-releases of containerd may depend features in `runc` Development (`-dev`) and pre-releases of containerd may depend features in `runc`
that have not yet been released, and may require a specific runc build. The version that have not yet been released, and may require a specific runc build. The version
of runc that is tested against in our CI can be found in the `RUNC_VERSION` variable of runc that is tested against in our CI can be found in the [`script/setup/runc-version`](../script/setup/runc-version)
in the [`script/setup/install-runc`](../script/setup/install-runc) script, which file, which may point to a git-commit (for pre releases) or tag in the runc
may point to a git-commit (for pre releases) or tag in the runc repository. repository.
For regular (non-pre-)releases of containerd releases, we attempt to use released For regular (non-pre-)releases of containerd releases, we attempt to use released
(tagged) versions of runc. We recommend using a version of runc that's equal to (tagged) versions of runc. We recommend using a version of runc that's equal to
or higher than the version of runc described in [`script/setup/install-runc`](../script/setup/install-runc). or higher than the version of runc described in [`script/setup/runc-version`](../script/setup/runc-version).
If you encounter any runtime errors, make sure your runc is in sync with the If you encounter any runtime errors, make sure your runc is in sync with the
commit or tag provided in that file. commit or tag provided in that file.

View File

@ -21,8 +21,10 @@
set -eu -o pipefail set -eu -o pipefail
function install_runc() { function install_runc() {
# When updating RUNC_VERSION, consider updating the runc module in go.mod as well script_dir="$(cd -- "$(dirname -- "$0")" > /dev/null 2>&1; pwd -P)"
: "${RUNC_VERSION:=v1.0.0-rc93}"
# When updating runc-version, consider updating the runc module in go.mod as well
: "${RUNC_VERSION:=$(cat "${script_dir}/runc-version")}"
TMPROOT=$(mktemp -d) TMPROOT=$(mktemp -d)
git clone https://github.com/opencontainers/runc.git "${TMPROOT}"/runc git clone https://github.com/opencontainers/runc.git "${TMPROOT}"/runc

View File

@ -0,0 +1 @@
v1.0.0-rc93