Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build distroless image using cekit in ci #118

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/build-distroless-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Create the container image providing the GraalVM specific distroless image
# Usage: build-distroless-images.sh
# Example:
# build-distroless-images.sh

set -e

PREFIX_NAME=quay.io/quarkus/quarkus-distroless-image
IMAGE=quarkus-distroless-image.yaml
BUILD_ENGINE=docker
VERSION=$1
OVERRIDES="{'version': '${VERSION}'}"

echo "Building version ${VERSION}"

virtualenv --python=python3 .cekit
source .cekit/bin/activate

echo "Generating ${PREFIX_NAME}:${VERSION}"
cekit --descriptor ${IMAGE} build \
--overrides "${OVERRIDES}" \
${BUILD_ENGINE} --tag="${PREFIX_NAME}:${VERSION}" --no-squash
9 changes: 9 additions & 0 deletions .github/distroless-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
image: quarkus-distroless-image.yaml
imageName: quay.io/quarkus/quarkus-distroless-image
buildScript: .github/build-distroless-images.sh
versions:
- 20.3.0-java11
tags:
- id: 20.3-java11
target: 20.3.0-java11
versionCheck: false
1 change: 1 addition & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
strategy:
matrix:
configuration:
- .github/distroless-images.yaml
- .github/native-images.yaml
- .github/mandrel-images.yaml
- .github/s2i-native-images.yaml
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
configuration:
- .github/distroless-images.yaml
- .github/native-images.yaml
- .github/mandrel-images.yaml
- .github/s2i-native-images.yaml
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ For other Systems, please refer to the docs.

The build scripts are located in the `.github` directory:

* `build-distroless-images.sh` - build the distroless images suitable for packaging native applications
* `build-mandrel-images.sh` - build the mandrel images
* `build-native-images.sh` - build the images providing the `native-image` executable
* `build-s2i-binary-images.sh` - build the s2i builder images taking a pre-built native executable
Expand Down
17 changes: 17 additions & 0 deletions quarkus-distroless-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: debian
version: stable-slim
cescoffier marked this conversation as resolved.
Show resolved Hide resolved
from: debian:stable-slim

# need to rename from image into "scratch" to disable /tmp cleanup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- name: scratch
version: latest
from: gcr.io/distroless/cc

- name: quay.io/quarkus/quarkus-distroless-image
version: latest
from: scratch
artifacts:
- name: libz.so.1
image: debian
path: /lib/x86_64-linux-gnu/libz.so.1
dest: /lib/x86_64-linux-gnu