Skip to content

Commit

Permalink
Change: Use (old)stable for release Docker images
Browse files Browse the repository at this point in the history
When building Docker images for release tags, use the oldstable
gvm-libs image and stable build image.
Otherwise use the oldstable-edge gvm-libs and edge build image.
  • Loading branch information
timopollmeier committed Jun 21, 2023
1 parent b5f99eb commit f3cf64f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .docker/build.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Define ARG we use through the build
ARG VERSION=oldstable
ARG GVM_LIBS_VERSION=oldstable

# We want gvm-libs to be ready so we use the build docker image of gvm-libs
FROM greenbone/gvm-libs:$VERSION
FROM greenbone/gvm-libs:$GVM_LIBS_VERSION

# This will make apt-get install without question
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ jobs:
# when a new git tag is created set stable and a latest tags
type=raw,value=latest,enable=${{ steps.latest.outputs.is-latest-tag == 'true' }}
type=raw,value=stable,enable=${{ steps.latest.outputs.is-latest-tag == 'true' }}
- name: Set container build options
id: container-opts
run: |
if [[ "${{ github.ref_type }}" = 'tag' ]]; then
echo "gvm-libs-version=oldstable" >> $GITHUB_OUTPUT
else
echo "gvm-libs-version=oldstable-edge" >> $GITHUB_OUTPUT
fi
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
Expand All @@ -69,6 +77,8 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GVM_LIBS_VERSION=${{ steps.container-opts.outputs.gvm-libs-version }}
file: .docker/build.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ jobs:
# when a new git tag is created set stable and a latest tags
type=raw,value=latest,enable=${{ steps.latest.outputs.is-latest-tag == 'true' }}
type=raw,value=stable,enable=${{ steps.latest.outputs.is-latest-tag == 'true' }}
- name: Set container build options
id: container-opts
run: |
if [[ "${{ github.ref_type }}" = 'tag' ]]; then
echo "version=stable" >> $GITHUB_OUTPUT
echo "gvm-libs-version=oldstable" >> $GITHUB_OUTPUT
else
echo "version=edge" >> $GITHUB_OUTPUT
echo "gvm-libs-version=oldstable-edge" >> $GITHUB_OUTPUT
fi
- name: Login to Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
Expand All @@ -58,6 +68,9 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' && (github.ref_type == 'tag' || github.ref_name == 'main') }}
build-args: |
VERSION=${{ steps.container-opts.outputs.version }}
GVM_LIBS_VERSION=${{ steps.container-opts.outputs.gvm-libs-version }}
file: .docker/prod.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit f3cf64f

Please sign in to comment.