-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support ARM64 when using Heroku-24 Docker images #717
Comments
Sure :) --- /dev/fd/11 2024-05-30 15:02:18.120265707 +0200
+++ Dockerfile 2024-05-30 15:02:04.954353346 +0200
@@ -1,11 +1,12 @@
FROM heroku/heroku:24-build as build
ENV STACK=heroku-24
+ENV HEROKU_PHP_PLATFORM_REPOSITORIES="- https://lang-php.s3.us-east-1.amazonaws.com/dist-heroku-24-arm64-develop/"
COPY --chown=heroku . /app
WORKDIR /app
# This is after the COPY line so buildpack updates are picked up.
RUN mkdir -p /tmp/buildpack /tmp/cache /tmp/env \
- && curl https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/php.tgz \
- | tar -xz -C /tmp/buildpack
+ && curl -sSL https://github.com/heroku/heroku-buildpack-php/archive/refs/heads/heroku-24.tar.gz \
+ | tar --strip-components 1 -xz -C /tmp/buildpack
RUN /tmp/buildpack/bin/compile /app /tmp/cache /tmp/env
FROM heroku/heroku:24 ⬇️⬇️⬇️⬇️⬇️ $ docker build --tag heroku-php-getting-started-heroku-24-arm-test --platform linux/arm64 .
…
$ docker run --rm -e PORT=5001 -p 5001:5001 heroku-php-getting-started-heroku-24-arm-test &
DOCUMENT_ROOT changed to 'web/'
Assuming RAM to be 512M Bytes
Available RAM is 512M Bytes
Number of CPU cores is 6
PHP memory_limit is 128M Bytes
Calculated number of workers based on RAM and CPU cores is 24
Maximum number of workers that fit available RAM at memory_limit is 4
Limiting number of workers to 4
Starting php-fpm with 4 workers...
Starting httpd...
Application ready for connections on port 5001.
$ curl -sSL localhost:5001 | head -n4
<!DOCTYPE html>
<html>
<head>
<title>PHP Getting Started on Heroku</title> |
Awesome! 😄 |
Merged
dzuelke
added a commit
that referenced
this issue
May 31, 2024
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Closes heroku#717 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Refs heroku#717 GUS-W-14667548 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Closes heroku#717 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Refs heroku#717 GUS-W-14667548 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Closes heroku#717 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Refs heroku#717 GUS-W-14667548 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Closes heroku#717 GUS-W-15158300
robinwo
pushed a commit
to robinwo/heroku-buildpack-php
that referenced
this issue
Sep 13, 2024
Refs heroku#717 GUS-W-14667548 GUS-W-15158300
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Heroku itself currently runs on AMD64 CPUs, however, some users use our buildpacks locally on machines with ARM64 CPUs (such as M1/M2/M3 MacBooks) with the Heroku base images published to Docker Hub.
As such there have been requests to support the ARM64 architecture, e.g.:
heroku/base-images#194
Starting with Heroku-24, the base images published to Docker Hub are now multi-architecture (AMD64 + ARM64), and our preview Cloud Native Buildpacks support ARM64 when using Heroku-24.
However, until CNBs leave preview there will still be users using our classic buildpacks with our base images from Docker Hub, so it would be ideal if we could add ARM64 support to our classic buildpacks too. This will not only make the images faster to run locally, but also avoid breaking local development workflows if users update to Heroku-24 and miss the mention in the stack upgrade notes about using
--platform linux/amd64
to force the architecture back to AMD64.For example, the buildpack should support:
git clone https://github.com/heroku/php-getting-started && cd php-getting-started
Dockerfile
with the below contents.docker build --tag arm-test --platform linux/arm64 .
docker run --rm -e PORT=5001 -p 5001:5001 arm-test
curl localhost:5001
The text was updated successfully, but these errors were encountered: