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

Added ARM64 support with multiarch build #227

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN_IMAGE_TAG="heroku/heroku:${STACK_VERSION}"
RUN_DOCKERFILE_DIR="heroku-${STACK_VERSION}"
[[ -d "${RUN_DOCKERFILE_DIR}" ]] || abort "fatal: directory ${RUN_DOCKERFILE_DIR} not found"
display "Building ${RUN_DOCKERFILE_DIR} / ${RUN_IMAGE_TAG} Heroku runtime image"
docker build --pull --tag "${RUN_IMAGE_TAG}" "${RUN_DOCKERFILE_DIR}" | indent
docker buildx build --pull --platform=linux/arm64,linux/amd64 --tag "${RUN_IMAGE_TAG}" "${RUN_DOCKERFILE_DIR}" | indent
write_package_list "${RUN_IMAGE_TAG}" "${RUN_DOCKERFILE_DIR}"

# The --pull option is not used for variants to ensure they are based on the
Expand All @@ -29,7 +29,7 @@ write_package_list "${RUN_IMAGE_TAG}" "${RUN_DOCKERFILE_DIR}"
BUILD_IMAGE_TAG="${RUN_IMAGE_TAG}-build"
BUILD_DOCKERFILE_DIR="${RUN_DOCKERFILE_DIR}-build"
display "Building ${BUILD_DOCKERFILE_DIR} / ${BUILD_IMAGE_TAG} Heroku build-time image"
docker build --tag "$BUILD_IMAGE_TAG" "$BUILD_DOCKERFILE_DIR" | indent
docker buildx build --platform=linux/arm64,linux/amd64 --tag "$BUILD_IMAGE_TAG" "$BUILD_DOCKERFILE_DIR" | indent
write_package_list "$BUILD_IMAGE_TAG" "$BUILD_DOCKERFILE_DIR"

# write_package_list is not needed for *cnb* variants, as they don't install
Expand All @@ -38,12 +38,12 @@ write_package_list "$BUILD_IMAGE_TAG" "$BUILD_DOCKERFILE_DIR"
CNB_RUN_IMAGE_TAG="${RUN_IMAGE_TAG}-cnb"
CNB_RUN_DOCKERFILE_DIR="${RUN_DOCKERFILE_DIR}-cnb"
display "Building ${CNB_RUN_DOCKERFILE_DIR} / ${CNB_RUN_IMAGE_TAG} CNB runtime image"
docker build --tag "$CNB_RUN_IMAGE_TAG" "$CNB_RUN_DOCKERFILE_DIR" | indent
docker buildx build --platform=linux/arm64,linux/amd64 --tag "$CNB_RUN_IMAGE_TAG" "$CNB_RUN_DOCKERFILE_DIR" | indent

CNB_BUILD_IMAGE_TAG="${RUN_IMAGE_TAG}-cnb-build"
CNB_BUILD_DOCKERFILE_DIR="${RUN_DOCKERFILE_DIR}-cnb-build"
display "Building ${CNB_BUILD_DOCKERFILE_DIR} / ${CNB_BUILD_IMAGE_TAG} CNB build-time image"
docker build --tag "$CNB_BUILD_IMAGE_TAG" "$CNB_BUILD_DOCKERFILE_DIR" | indent
docker buildx build --platform=linux/arm64,linux/amd64 --tag "$CNB_BUILD_IMAGE_TAG" "$CNB_BUILD_DOCKERFILE_DIR" | indent

display "Size breakdown..."
docker images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" \
Expand Down
11 changes: 7 additions & 4 deletions heroku-18/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export DEBIAN_FRONTEND=noninteractive

# The default sources list minus backports, restricted and multiverse.
cat >/etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu/ bionic main universe
deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic-security main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
deb [arch=arm64] http://ports.ubuntu.com/ bionic main universe
deb [arch=arm64] http://ports.ubuntu.com/ bionic-security main universe
deb [arch=arm64] http://ports.ubuntu.com/ bionic-updates main universe
EOF

apt-get update
Expand Down Expand Up @@ -195,7 +198,7 @@ apt-get install -y --no-install-recommends \
shared-mime-info \
socat \
stunnel \
syslinux \
syslinux-common \
tar \
telnet \
tzdata \
Expand Down
11 changes: 7 additions & 4 deletions heroku-20/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export DEBIAN_FRONTEND=noninteractive

# The default sources list minus backports, restricted and multiverse.
cat >/etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu/ focal main universe
deb http://archive.ubuntu.com/ubuntu/ focal-security main universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-security main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal-updates main universe
deb [arch=arm64] http://ports.ubuntu.com/ focal main universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-security main universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main universe
EOF

apt-get update
Expand Down Expand Up @@ -197,7 +200,7 @@ apt-get install -y --no-install-recommends \
shared-mime-info \
socat \
stunnel \
syslinux \
syslinux-common \
tar \
telnet \
tzdata \
Expand Down
2 changes: 1 addition & 1 deletion heroku-22-build/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ apt-get install -y --no-install-recommends \
libonig-dev \
libpam0g-dev \
libpopt-dev \
libpq-dev \
libpq-dev=14.5-1.pgdg22.04+1 \
librabbitmq-dev \
libreadline-dev \
librtmp-dev \
Expand Down
3 changes: 1 addition & 2 deletions heroku-22/installed-packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ mawk
media-types
mlock
mount
mtools
boboldehampsink marked this conversation as resolved.
Show resolved Hide resolved
mysql-common
ncurses-base
ncurses-bin
Expand Down Expand Up @@ -341,7 +340,7 @@ sensible-utils
shared-mime-info
socat
stunnel4
syslinux
syslinux-common
systemd
sysvinit-utils
tar
Expand Down
11 changes: 7 additions & 4 deletions heroku-22/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export DEBIAN_FRONTEND=noninteractive

# The default sources list minus backports, restricted and multiverse.
cat >/etc/apt/sources.list <<EOF
deb http://archive.ubuntu.com/ubuntu/ jammy main universe
deb http://archive.ubuntu.com/ubuntu/ jammy-security main universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-security main universe
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main universe
deb [arch=arm64] http://ports.ubuntu.com/ jammy main universe
deb [arch=arm64] http://ports.ubuntu.com/ jammy-security main universe
deb [arch=arm64] http://ports.ubuntu.com/ jammy-updates main universe
EOF

apt-get update
Expand Down Expand Up @@ -197,7 +200,7 @@ apt-get install -y --no-install-recommends \
shared-mime-info \
socat \
stunnel \
syslinux \
syslinux-common \
tar \
telnet \
tzdata \
Expand Down