Skip to content

Commit 77c2edc

Browse files
authored
Separate prebuilt image packages (#72)
1 parent a07bab0 commit 77c2edc

17 files changed

Lines changed: 54 additions & 17 deletions

File tree

.github/actions/smoke-test/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PREBUILD_DIR="prebuild/${TEMPLATE_ID}"
1616
if [ -d "${PREBUILD_DIR}" ] ; then
1717
RUNTIME_OPTION=$(jq -r '.options | keys[] | select(. != "azureFunctionsCliVersion")' "src/${TEMPLATE_ID}/devcontainer-template.json")
1818
RUNTIME_VERSION=$(jq -r ".options | .${RUNTIME_OPTION} | .default" "src/${TEMPLATE_ID}/devcontainer-template.json")
19-
PREBUILD_IMAGE="ghcr.io/shibayan/devcontainers/${TEMPLATE_ID}:${RUNTIME_VERSION}-noble"
19+
PREBUILD_IMAGE="ghcr.io/shibayan/devcontainers/${TEMPLATE_ID}-base:${RUNTIME_VERSION}-noble"
2020

2121
if [ -z "${RUNTIME_OPTION}" ] || [ -z "${RUNTIME_VERSION}" ] || [ "${RUNTIME_VERSION}" = "null" ] ; then
2222
echo "Unable to determine the runtime version for '${TEMPLATE_ID}'"

.github/workflows/prebuild.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- ubuntu-24.04-arm
6060
env:
6161
RUNTIME_VERSION: ${{ matrix.config.runtime }}
62-
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/devcontainers/${{ matrix.config.template }}
62+
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/devcontainers/${{ matrix.config.template }}-base
6363
steps:
6464
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6565

@@ -103,7 +103,7 @@ jobs:
103103
matrix:
104104
config: ${{ fromJSON(needs.prepare.outputs.configs) }}
105105
env:
106-
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/devcontainers/${{ matrix.config.template }}
106+
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/devcontainers/${{ matrix.config.template }}-base
107107
RUNTIME_VERSION: ${{ matrix.config.runtime }}
108108
steps:
109109
- name: Log in to GitHub Container Registry
@@ -133,3 +133,31 @@ jobs:
133133
any(.manifests[]; .platform.os == "linux" and .platform.architecture == $architecture)
134134
' <<< "${manifest}" > /dev/null
135135
done
136+
137+
verify-public:
138+
needs:
139+
- prepare
140+
- merge
141+
runs-on: ubuntu-24.04
142+
env:
143+
CONFIGS: ${{ needs.prepare.outputs.configs }}
144+
steps:
145+
- name: Verify anonymous image access
146+
shell: bash
147+
run: |
148+
failed=false
149+
while IFS= read -r config; do
150+
template=$(jq -r '.template' <<< "${config}")
151+
runtime=$(jq -r '.runtime' <<< "${config}")
152+
image="ghcr.io/${GITHUB_REPOSITORY_OWNER}/devcontainers/${template}-base:${runtime}-noble"
153+
154+
echo "Verifying anonymous access to ${image}"
155+
if ! docker buildx imagetools inspect "${image}" > /dev/null; then
156+
echo "::error::Package '${template}-base' must be made public in GitHub Packages."
157+
failed=true
158+
fi
159+
done < <(jq -c '.[]' <<< "${CONFIGS}")
160+
161+
if [ "${failed}" = true ]; then
162+
exit 1
163+
fi

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runtime_option=$(jq -r '.options | keys[] | select(. != "azureFunctionsCliVersion")' "${manifest_path}")
2222
2323
while IFS= read -r runtime_version; do
24-
image="ghcr.io/${GITHUB_REPOSITORY_OWNER}/devcontainers/${template}:${runtime_version}-noble"
24+
image="ghcr.io/${GITHUB_REPOSITORY_OWNER}/devcontainers/${template}-base:${runtime_version}-noble"
2525
echo "Verifying ${image}"
2626
manifest=$(docker buildx imagetools inspect --raw "${image}")
2727

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A collection of [Dev Container Templates](https://containers.dev/implementors/te
1515

1616
> All templates include the Azure Functions Core Tools (version selectable, default: `latest`).
1717
18-
All language runtimes are provided through prebuilt Ubuntu 24.04 images for both AMD64 and ARM64. The templates add the selected Azure Functions Core Tools version when the development container is created.
18+
All language runtimes are provided through separate `*-base` prebuilt Ubuntu 24.04 images for both AMD64 and ARM64. The templates add the selected Azure Functions Core Tools version when the development container is created.
1919

2020
## Usage
2121

prebuild/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Prebuilt Runtime Images
2+
3+
This directory contains the Dev Container definitions used to build the Ubuntu 24.04 runtime images referenced by the templates in `src`.
4+
5+
Each language is published to a separate GHCR package whose name ends in `-base`. Images are published for AMD64 and ARM64 with rolling, dated, and revision tags.
6+
7+
GitHub Container Registry creates new packages as private. After the first successful image push for a language, change the corresponding `*-base` package visibility to public and rerun the workflow. The final workflow job verifies that every image can be pulled anonymously.
8+
9+
Previously published runtime tags without the `-base` package suffix must remain available because template versions published before this separation reference those tags.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/shibayan/devcontainers/azure-functions-dotnet:${templateOption:dotnetVersion}-noble
1+
FROM ghcr.io/shibayan/devcontainers/azure-functions-dotnet-base:${templateOption:dotnetVersion}-noble

src/azure-functions-dotnet/devcontainer-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "azure-functions-dotnet",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"name": "Azure Functions (.NET)",
55
"description": "Develop C# and .NET based Azure Functions. Includes all needed SDKs, extensions, and dependencies.",
66
"documentationURL": "https://github.com/shibayan/devcontainers/tree/master/src/azure-functions-dotnet",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/shibayan/devcontainers/azure-functions-go:${templateOption:goVersion}-noble
1+
FROM ghcr.io/shibayan/devcontainers/azure-functions-go-base:${templateOption:goVersion}-noble

src/azure-functions-go/devcontainer-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "azure-functions-go",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"name": "Azure Functions (Go)",
55
"description": "Develop Go based Azure Functions. Includes all needed SDKs, extensions, and dependencies.",
66
"documentationURL": "https://github.com/shibayan/devcontainers/tree/master/src/azure-functions-go",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/shibayan/devcontainers/azure-functions-java:${templateOption:javaVersion}-noble
1+
FROM ghcr.io/shibayan/devcontainers/azure-functions-java-base:${templateOption:javaVersion}-noble

0 commit comments

Comments
 (0)