Update the docker build to include features based images (#3875)

## Proposed Changes

There are some features that are enabled/disabled with the `FEATURES` env variable. This PR would introduce a pattern to introduce docker images based on those features. This can be useful later on to have specific images for some experimental features in the future.

## Additional Info

We at Lodesart need to have `minimal` spec support for some cross-client network testing. To make it efficient on the CI, we tend to use minimal preset.
This commit is contained in:
Nazar Hussain
2023-02-08 02:18:51 +00:00
parent 9547ac069c
commit 7934485aef
2 changed files with 17 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ jobs:
VERSION: ${{ env.VERSION }}
VERSION_SUFFIX: ${{ env.VERSION_SUFFIX }}
build-docker-single-arch:
name: build-docker-${{ matrix.binary }}
name: build-docker-${{ matrix.binary }}${{ matrix.features.version_suffix }}
runs-on: ubuntu-22.04
strategy:
matrix:
@@ -51,6 +51,10 @@ jobs:
aarch64-portable,
x86_64,
x86_64-portable]
features: [
{version_suffix: "", env: ""},
{version_suffix: "-dev", env: "spec-minimal"}
]
include:
- profile: maxperf
@@ -60,6 +64,8 @@ jobs:
DOCKER_CLI_EXPERIMENTAL: enabled
VERSION: ${{ needs.extract-version.outputs.VERSION }}
VERSION_SUFFIX: ${{ needs.extract-version.outputs.VERSION_SUFFIX }}
FEATURE_SUFFIX: ${{ matrix.features.version_suffix }}
FEATURES: ${{ matrix.features.env }}
steps:
- uses: actions/checkout@v3
- name: Update Rust
@@ -98,8 +104,9 @@ jobs:
docker buildx build \
--platform=linux/${SHORT_ARCH} \
--file ./Dockerfile.cross . \
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX}${MODERNITY_SUFFIX} \
--provenance=false \
--tag ${IMAGE_NAME}:${VERSION}-${SHORT_ARCH}${VERSION_SUFFIX}${MODERNITY_SUFFIX}${FEATURE_SUFFIX} \
--build-arg FEATURES=${FEATURES} \
--provenance=false \
--push
build-docker-multiarch:
name: build-docker-multiarch${{ matrix.modernity }}