This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
forked from heroku/base-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add heroku/heroku:24 and heroku/heroku:24-build as multiarch images (h…
…eroku#245) * Add heroku-24 and heroku-24-build as multiarch * Don't create /app or /workspace or set them as $HOME * Regenerate installed-packages.txt * Drop mtools. It was a dependency of syslinux, which is no longer installed * Also write the package list for build variants * Regenerate installed packages for heroku-24 * Drop ghostscript, libgs10, libgs10-dev, gsfonts * Add 24 to the CI matrix * Enable the multiarch driver * Don't try to push cnb variants for heroku-24 * Drop language-pack-en * Use --load for buildx builds * Generate locale for en_us * Rework scripting to handle multiarch, single arch, linux docker, and docker desktop * If we're not pushing, we're loading. buildx requires us to be explicit * Be explicit about what platform to build for 24 single architecture builds * Detect docker-container driver and containerd snapshotter rather than Docker Desktop * Regenerate installed packages * Print detailed usage context * Fix erroneous argument check * Drop brz and python3-dev * Update installed packages list * Drop socat and telnet * Drop explicit ed dependency * Regenerate package lists for heroku-24 * Generate package lists for all architectures when possible * Add CNB Spec reference Co-authored-by: Ed Morley <[email protected]> * Add CNB Spec reference Co-authored-by: Ed Morley <[email protected]> * Address formatting, output, and exit code feedback * Use bash double brackets / parens * Use RUN --mount to drop COPY step * Drop redundant label * Separate build and run users for heroku-24 * Add ed, socat, telnet back into the package list for heroku-24 * Drop unused internalTag * Update to libmagickcore-6.q16-7-extra and regenerate package lists * Fix multi-arch conditional * Use double brackets for publishing script * Drop unnecessary $ in arithmetic * Use noble channel for postgres, now that it is available * Add a comment explaining locale-gen * Update imagemagick policy to match ubuntu defaults * Reorder magick policy to match more closely to ubuntu * Publish to public temp tags instead of private * Drop shared cache weak secret in imagemagick config * Unpublish temp tags after CI * Fixup unpublish step * Stop generating imagemagick policy, since ubuntu's is fine * Fix syntax for docker hub delete curl command * Update tag deletion to v2 url * Fix error handling during unpublish * Update heroku-24 package lists * Regenerate heroku-24-build package lists * Update incorrect usage messaging Signed-off-by: Josh W Lewis <[email protected]> * Fix some leading spaces to tabs in bin/build.sh * Update curl and jq usage to match languages standards Co-authored-by: Ed Morley <[email protected]> * Update curl and jq usage to match languages standards Co-authored-by: Ed Morley <[email protected]> * Construct targetTagName only once, and reindent bin/unpublish-tags.sh --------- Signed-off-by: Josh W Lewis <[email protected]> Co-authored-by: Ed Morley <[email protected]> Co-authored-by: David Zülke <[email protected]>
- Loading branch information
1 parent
7a0073e
commit d1ab0cb
Showing
20 changed files
with
2,539 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
dockerhub_token=$(curl -sS -f --retry 3 --retry-connrefused --connect-timeout 5 --max-time 30 -H "Content-Type: application/json" -X POST -d "{\"username\": \"${DOCKER_HUB_USERNAME}\", \"password\": \"${DOCKER_HUB_TOKEN}\"}" https://hub.docker.com/v2/users/login/ | jq --exit-status -r .token) | ||
|
||
unpublish_group() { | ||
local stackVersion="$1" | ||
local targetTagSuffix="$2" | ||
local status=0 | ||
variants=("" "-build") | ||
if (( stackVersion <= 22 )); then | ||
variants+=("-cnb" "-cnb-build") | ||
fi | ||
for variant in "${variants[@]}"; do | ||
targetTagName="${stackVersion}${variant}${targetTagSuffix}" | ||
echo "Deleting heroku/heroku:${targetTagName}" | ||
response=$(curl -sS --retry 3 --retry-connrefused --connect-timeout 5 --max-time 30 -X DELETE \ | ||
-H "Authorization: JWT ${dockerhub_token}" \ | ||
"https://hub.docker.com/v2/namespaces/heroku/repositories/heroku/tags/${targetTagName}" | ||
) | ||
|
||
if [[ -z $response ]]; then | ||
>&2 echo "Deleted." | ||
elif [[ $response =~ "tag not found" ]]; then | ||
>&2 echo "Tag does not exist." | ||
else | ||
>&2 echo "Couldn't delete. Response: ${response}" | ||
status=22 | ||
fi | ||
done | ||
return $status | ||
} | ||
|
||
stackVersion="${1:-$STACK_VERSION}" | ||
tempTagSuffix="${2:-".temp-$GITHUB_RUN_ID"}" | ||
# delete each tag in a group on Docker Hub. | ||
unpublish_group "${stackVersion}" "${tempTagSuffix}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
FROM heroku/heroku:20 | ||
ARG BASE_IMAGE=heroku/heroku:20 | ||
FROM $BASE_IMAGE | ||
COPY setup.sh /tmp/setup.sh | ||
RUN /tmp/setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM heroku/heroku:20 | ||
ARG BASE_IMAGE=heroku/heroku:20 | ||
FROM $BASE_IMAGE | ||
|
||
RUN ln -s /workspace /app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
FROM heroku/heroku:22 | ||
ARG BASE_IMAGE=heroku/heroku:22 | ||
FROM $BASE_IMAGE | ||
COPY setup.sh /tmp/setup.sh | ||
RUN /tmp/setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM heroku/heroku:22 | ||
ARG BASE_IMAGE=heroku/heroku:22 | ||
FROM $BASE_IMAGE | ||
|
||
RUN ln -s /workspace /app | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
installed-packages*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ARG BASE_IMAGE=heroku/heroku:24 | ||
FROM $BASE_IMAGE | ||
USER root | ||
RUN --mount=target=/build /build/setup.sh | ||
|
||
# https://github.com/buildpacks/spec/blob/main/platform.md#build-image | ||
USER 1002 | ||
ENV CNB_USER_ID=1002 | ||
ENV CNB_GROUP_ID=1000 | ||
ENV CNB_STACK_ID "heroku-24" |
Oops, something went wrong.