This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo-docker.git
The following commit(s) were added to refs/heads/main by this push:
new ce3b179 Add container publish/delete workflows (#35)
ce3b179 is described below
commit ce3b17918ae38f03b2991a66648487f57fa47954
Author: Christopher Tubbs <[email protected]>
AuthorDate: Tue Nov 17 17:49:21 2026 -0500
Add container publish/delete workflows (#35)
Support building a tagged container image to private GHCR using the
current repo's name.
Also support deleting an image matching a tag or sha256, or the entire
package (all tagged and untagged images with the repo's name) from the
GHCR package repository.
Also add ASF's workflow to check for approved GitHub Actions
Co-authored-by: OpenAI GPT-6 Luna
---
.github/workflows/asf-allowlist-check.yml | 41 +++++++++++
.github/workflows/delete-package.yml | 113 ++++++++++++++++++++++++++++++
.github/workflows/publish-image.yml | 104 +++++++++++++++++++++++++++
CONTRIBUTING.md | 2 +-
Dockerfile | 2 +-
NOTICE | 4 +-
download.sh | 8 +--
7 files changed, 264 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/asf-allowlist-check.yml
b/.github/workflows/asf-allowlist-check.yml
new file mode 100644
index 0000000..e31e2dc
--- /dev/null
+++ b/.github/workflows/asf-allowlist-check.yml
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# See
https://github.com/apache/infrastructure-actions/tree/main/allowlist-check
+
+name: "ASF Allowlist Check"
+
+on:
+ workflow_dispatch:
+ pull_request:
+ paths:
+ - ".github/**"
+ push:
+ branches:
+ - main
+ paths:
+ - ".github/**"
+
+permissions:
+ contents: read
+
+jobs:
+ asf-allowlist-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - uses: apache/infrastructure-actions/allowlist-check@main
diff --git a/.github/workflows/delete-package.yml
b/.github/workflows/delete-package.yml
new file mode 100644
index 0000000..90004f2
--- /dev/null
+++ b/.github/workflows/delete-package.yml
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: GHCR delete container image
+
+on:
+ workflow_dispatch:
+ inputs:
+ confirm_image:
+ description: Type the published image name (ghcr.io/owner/repository)
to confirm
+ required: true
+ type: string
+ version:
+ description: Image tag or sha256 digest to delete, or ALL to delete
the entire package
+ required: true
+ type: string
+
+permissions:
+ packages: write
+
+jobs:
+ delete:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Verify confirmation
+ env:
+ CONFIRM_IMAGE: ${{ inputs.confirm_image }}
+ REPOSITORY: ${{ github.repository }}
+ VERSION: ${{ inputs.version }}
+ run: |
+ set -eu
+ image="ghcr.io/$(printf '%s' "$REPOSITORY" | tr '[:upper:]'
'[:lower:]')"
+ package_name="${image##*/}"
+ if [ "$CONFIRM_IMAGE" != "$image" ]; then
+ echo "Confirmation did not match published image '$image'; nothing
was deleted." >&2
+ exit 1
+ fi
+ if [ -z "$VERSION" ]; then
+ echo "A version tag, SHA-256 digest, or ALL must be provided." >&2
+ exit 1
+ fi
+ {
+ echo "PACKAGE_NAME=$package_name"
+ echo "IMAGE=$image"
+ } >> "$GITHUB_ENV"
+
+ - name: Delete package or version from GitHub Container Registry
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ OWNER: ${{ github.repository_owner }}
+ VERSION: ${{ inputs.version }}
+ run: |
+ set -euo pipefail
+ if [ "$VERSION" = "ALL" ]; then
+ echo "Deleting entire package: ${IMAGE}"
+ gh api --method DELETE
"/orgs/${OWNER}/packages/container/${PACKAGE_NAME}"
+ exit 0
+ fi
+
+ digest=""
+ if [[ "$VERSION" == sha256:* ]]; then
+ if ! [[ "$VERSION" =~ ^sha256:[0-9a-fA-F]{64}$ ]]; then
+ echo "Invalid SHA-256 digest: $VERSION" >&2
+ exit 1
+ fi
+ digest="sha256:$(printf '%s' "${VERSION#sha256:}" | tr '[:upper:]'
'[:lower:]')"
+ elif [[ "$VERSION" =~ ^[0-9a-fA-F]{64}$ ]]; then
+ digest="sha256:$(printf '%s' "$VERSION" | tr '[:upper:]'
'[:lower:]')"
+ fi
+
+ if [ -n "$digest" ]; then
+ echo "Finding version with digest '$digest' in ${IMAGE}"
+ else
+ echo "Finding version tagged '$VERSION' in ${IMAGE}"
+ fi
+ versions_file="$RUNNER_TEMP/package-versions.jsonl"
+ gh api --paginate --jq '.[]' \
+
"/orgs/${OWNER}/packages/container/${PACKAGE_NAME}/versions?per_page=100" \
+ > "$versions_file"
+ mapfile -t version_ids < <(
+ jq -s --arg tag "$VERSION" --arg digest "$digest" \
+ '[.[] | select(if $digest != "" then (.name == $digest or
.metadata.container.digest == $digest) else any(.metadata.container.tags[]?; .
== $tag) end)] | .[].id' \
+ "$versions_file"
+ )
+ if [ "${#version_ids[@]}" -eq 0 ]; then
+ echo "No package version found matching '$VERSION'." >&2
+ exit 1
+ fi
+ if [ "${#version_ids[@]}" -ne 1 ]; then
+ echo "Found multiple package versions matching '$VERSION';
refusing to delete." >&2
+ exit 1
+ fi
+
+ version_id="${version_ids[0]}"
+ if ! [[ "$version_id" =~ ^[0-9]+$ ]]; then
+ echo "Invalid package version ID returned by GitHub: $version_id"
>&2
+ exit 1
+ fi
+ echo "Deleting ${IMAGE} version '$VERSION' (package version ID
$version_id)"
+ gh api --method DELETE \
+
"/orgs/${OWNER}/packages/container/${PACKAGE_NAME}/versions/${version_id}"
diff --git a/.github/workflows/publish-image.yml
b/.github/workflows/publish-image.yml
new file mode 100644
index 0000000..b5482be
--- /dev/null
+++ b/.github/workflows/publish-image.yml
@@ -0,0 +1,104 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: GHCR publish container image
+
+on:
+ workflow_dispatch:
+ inputs:
+ tags:
+ description: Comma- or newline-separated image tags to publish
+ required: true
+ type: string
+ default: latest
+ accumulo_version:
+ description: Released Accumulo version available from Apache's
distribution mirrors
+ required: true
+ type: string
+
+permissions:
+ contents: read
+ packages: write
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+
+ - name: Set image name
+ id: image
+ run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
+
+ - name: Prepare image tags
+ id: tags
+ env:
+ IMAGE: ${{ steps.image.outputs.name }}
+ INPUT_TAGS: ${{ inputs.tags }}
+ run: |
+ set -eu
+ tags_file="$RUNNER_TEMP/image-tags"
+ : > "$tags_file"
+ while IFS= read -r tag; do
+ tag="$(printf '%s' "$tag" | sed 's/^[[:space:]]*//;
s/[[:space:]]*$//')"
+ [ -z "$tag" ] && continue
+ if ! [[ "$tag" =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$ ]]; then
+ echo "Invalid Docker image tag: $tag" >&2
+ exit 1
+ fi
+ printf '%s:%s\n' "$IMAGE" "$tag" >> "$tags_file"
+ done < <(printf '%s\n' "$INPUT_TAGS" | tr ',' '\n')
+
+ if [ ! -s "$tags_file" ]; then
+ echo "At least one image tag must be provided." >&2
+ exit 1
+ fi
+ delimiter="$(openssl rand -hex 16)"
+ {
+ echo "tags<<$delimiter"
+ cat "$tags_file"
+ echo "$delimiter"
+ } >> "$GITHUB_OUTPUT"
+
+ - name: Set up Docker Buildx
+ uses:
docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
+
+ - name: Extract image metadata
+ id: meta
+ uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
# v6.2.0
+ with:
+ images: ${{ steps.image.outputs.name }}
+ labels: |
+ org.opencontainers.image.source=https://github.com/${{
github.repository }}
+
+ - name: Log in to GitHub Container Registry
+ uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 #
v4.8.0
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and publish image
+ uses:
docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
+ with:
+ context: .
+ push: true
+ build-args: |
+ ACCUMULO_VERSION=${{ inputs.accumulo_version }}
+ tags: ${{ steps.tags.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7daf3d0..3aea2cb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,7 +6,7 @@ The ASF licenses this file to You under the Apache License,
Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/Dockerfile b/Dockerfile
index f8515aa..a8ee685 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,7 +5,7 @@
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/NOTICE b/NOTICE
index 3aa48d9..23103e9 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache Accumulo Docker
-Copyright 2019 The Apache Software Foundation
+Copyright 2019-2026 The Apache Software Foundation
This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
+The Apache Software Foundation (https://www.apache.org/).
diff --git a/download.sh b/download.sh
index 985caa3..66e2dac 100755
--- a/download.sh
+++ b/download.sh
@@ -7,7 +7,7 @@
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,11 +18,7 @@
set -euo pipefail
APACHE_DIST_URLS=(
- "https://www.apache.org/dyn/closer.cgi?action=download&filename="
- # if the version is outdated (or we're grabbing the .asc file), we might
have to pull from the dist/archive :/
- "https://www-us.apache.org/dist/"
- "https://www.apache.org/dist/"
- "https://archive.apache.org/dist/"
+ 'https://dlcdn.apache.org/'
)
download() {