distroless image: minor changes

This commit is contained in:
Nicola Murino
2021-09-07 19:52:28 +02:00
parent c106498dd8
commit 90f64c9f63
3 changed files with 27 additions and 24 deletions

View File

@@ -21,10 +21,13 @@ jobs:
docker_pkg:
- debian
- alpine
- distroless
optional_deps:
- true
- false
include:
- os: ubuntu-latest
docker_pkg: distroless
optional_deps: false
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -65,9 +68,9 @@ jobs:
VERSION="${VERSION}-alpine"
VERSION_SLIM="${VERSION}-slim"
DOCKERFILE=Dockerfile.alpine
fi
if [[ $DOCKER_PKG == distroless ]]; then
VERSION_SLIM="${VERSION}-distroless-slim"
elif [[ $DOCKER_PKG == distroless ]]; then
VERSION="${VERSION}-distroless"
VERSION_SLIM="${VERSION}-slim"
DOCKERFILE=Dockerfile.distroless
fi
DOCKER_IMAGES=("drakkan/sftpgo" "ghcr.io/drakkan/sftpgo")
@@ -89,9 +92,11 @@ jobs:
TAGS_SLIM="${TAGS_SLIM},${DOCKER_IMAGE}:slim"
elif [[ $DOCKER_PKG == distroless ]]; then
if [[ -n $MAJOR && -n $MINOR ]]; then
TAGS="${TAGS},${DOCKER_IMAGE}:${MINOR}-distroless,${DOCKER_IMAGE}:${MAJOR}-distroless"
TAGS_SLIM="${TAGS_SLIM},${DOCKER_IMAGE}:${MINOR}-distroless-slim,${DOCKER_IMAGE}:${MAJOR}-distroless-slim"
fi
TAGS_SLIM="${TAGS_SLIM},${DOCKER_IMAGE}:slim"
TAGS="${TAGS},${DOCKER_IMAGE}:distroless"
TAGS_SLIM="${TAGS_SLIM},${DOCKER_IMAGE}:distroless-slim"
else
if [[ -n $MAJOR && -n $MINOR ]]; then
TAGS="${TAGS},${DOCKER_IMAGE}:${MINOR}-alpine,${DOCKER_IMAGE}:${MAJOR}-alpine"
@@ -104,14 +109,9 @@ jobs:
done
if [[ $OPTIONAL_DEPS == true ]]; then
if [[ $DOCKER_PKG != distroless ]]; then
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=full::true
else
# skip for distroless no slim
echo ::set-output name=skip_build_and_push_step::true
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=full::true
else
echo ::set-output name=version::${VERSION_SLIM}
echo ::set-output name=tags::${TAGS_SLIM}
@@ -167,6 +167,4 @@ jobs:
org.opencontainers.image.version=${{ steps.info.outputs.version }}
org.opencontainers.image.created=${{ steps.info.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}
# skip for distroless no slim
if: ${{ steps.info.outputs.skip_build_and_push_step != 'true' }}
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}