Add opencontainers annotations to docker image (#1136)
Co-authored-by: Rahuλ Dé <lispyclouds@users.noreply.github.com>
This commit is contained in:
parent
9cf6a1ae71
commit
6e2c32ff84
2 changed files with 14 additions and 3 deletions
|
|
@ -6,6 +6,15 @@ image_name="babashka/babashka"
|
||||||
image_tag=$(cat resources/BABASHKA_VERSION)
|
image_tag=$(cat resources/BABASHKA_VERSION)
|
||||||
platform=${PLATFORM:-"linux/amd64"}
|
platform=${PLATFORM:-"linux/amd64"}
|
||||||
latest_tag="latest"
|
latest_tag="latest"
|
||||||
|
label_args="--label \"org.opencontainers.image.description=Native, fast starting Clojure interpreter for scripting\" \
|
||||||
|
--label \"org.opencontainers.image.title=Babashka\" \
|
||||||
|
--label \"org.opencontainers.image.created=`date -Iseconds`\" \
|
||||||
|
--label \"org.opencontainers.image.url=${CIRCLE_REPOSITORY_URL}\" \
|
||||||
|
--label \"org.opencontainers.image.documentation=${CIRCLE_REPOSITORY_URL}\" \
|
||||||
|
--label \"org.opencontainers.image.source=${CIRCLE_REPOSITORY_URL}\" \
|
||||||
|
--label \"org.opencontainers.image.revision=${CIRCLE_SHA1}\" \
|
||||||
|
--label \"org.opencontainers.image.ref.name=${CIRCLE_TAG:${CIRCLE_BRANCH}}\" \
|
||||||
|
--label \"org.opencontainers.image.version=${image_tag}\""
|
||||||
|
|
||||||
if [[ $image_tag =~ SNAPSHOT$ ]]; then
|
if [[ $image_tag =~ SNAPSHOT$ ]]; then
|
||||||
echo "This is a snapshot version"
|
echo "This is a snapshot version"
|
||||||
|
|
@ -25,10 +34,10 @@ if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then
|
||||||
mkdir -p $p
|
mkdir -p $p
|
||||||
tar zxvf "/tmp/release/babashka-${image_tag}-${tarball_platform}.tar.gz" -C $p
|
tar zxvf "/tmp/release/babashka-${image_tag}-${tarball_platform}.tar.gz" -C $p
|
||||||
done
|
done
|
||||||
docker buildx build -t "$image_name:$image_tag" --platform "$platform" --push -f Dockerfile.ci .
|
docker buildx build -t "$image_name:$image_tag" --platform "$platform" "$label_args" --push -f Dockerfile.ci .
|
||||||
if [[ $snapshot == "false" ]]; then
|
if [[ $snapshot == "false" ]]; then
|
||||||
echo "Building & pushing $platform Docker image(s) $image_name:$latest_tag"
|
echo "Building & pushing $platform Docker image(s) $image_name:$latest_tag"
|
||||||
docker buildx build -t "$image_name:$latest_tag" --platform "$platform" --push -f Dockerfile.ci .
|
docker buildx build -t "$image_name:$latest_tag" --platform "$platform" "$label_args" --push -f Dockerfile.ci .
|
||||||
fi
|
fi
|
||||||
for p in "${platforms[@]}"; do
|
for p in "${platforms[@]}"; do
|
||||||
rm -rf $p
|
rm -rf $p
|
||||||
|
|
@ -37,7 +46,7 @@ if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then
|
||||||
# alpine doesn't provide upstream arm64 images yet
|
# alpine doesn't provide upstream arm64 images yet
|
||||||
if [[ $platform == "linux-amd64" ]]; then
|
if [[ $platform == "linux-amd64" ]]; then
|
||||||
tar zxvf "/tmp/release/babashka-${image_tag}-${platform}-static.tar.gz"
|
tar zxvf "/tmp/release/babashka-${image_tag}-${platform}-static.tar.gz"
|
||||||
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
docker build -t "$image_name:alpine" "$label_args" -f Dockerfile.alpine .
|
||||||
rm -f bb
|
rm -f bb
|
||||||
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
||||||
echo "Pushing image $image_name:$image_tag-alpine"
|
echo "Pushing image $image_name:$image_tag-alpine"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ For a list of breaking changes, check [here](#breaking-changes).
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Add opencontainers annoations to docker image [#1134](https://github.com/babashka/babashka/issues/1134)
|
||||||
- Add metabom jar to docker images [#1133](https://github.com/babashka/babashka/issues/1133)
|
- Add metabom jar to docker images [#1133](https://github.com/babashka/babashka/issues/1133)
|
||||||
|
|
||||||
## 0.7.3 (2021-12-30)
|
## 0.7.3 (2021-12-30)
|
||||||
|
|
||||||
- Do not require java for bb tasks without deps [#1123](https://github.com/babashka/babashka/issues/1123), [#1124](https://github.com/babashka/babashka/issues/1124)
|
- Do not require java for bb tasks without deps [#1123](https://github.com/babashka/babashka/issues/1123), [#1124](https://github.com/babashka/babashka/issues/1124)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue