heroku/base-images

heroku/heroku:22 doesn't download standard library

IvoPereira opened this issue · 1 comments

Hi there!

We have been trying to test the new 22 stack ir our Dockerfiles. However, whenever we try to build using the new stack we are faced with the following:

Step 12/13 : RUN /tmp/buildpack/php/bin/compile /app /tmp/build_cache /tmp/env
 ---> Running in 638f1811c565

 !     ERROR: Failed to download standard library for bootstrapping!
 !     
 !     This is most likely a temporary internal error. If the problem
 !     persists, make sure that you are not running a custom or forked
 !     version of the Heroku PHP buildpack which may need updating.

For reference our Dockerfile is in these lines:

FROM heroku/heroku:22 as base

ENV STACK heroku-22
ENV PHP_BUILDPACK_FILE php.tgz
ENV APP /app
ENV HOME $APP

ADD . $APP
WORKDIR $APP

RUN mkdir -p /tmp/buildpack/php /tmp/build_cache /tmp/env
ADD https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/$PHP_BUILDPACK_FILE ./
RUN tar -xzvf $PHP_BUILDPACK_FILE -C /tmp/buildpack/php --strip-components 1 && rm $PHP_BUILDPACK_FILE

# Bootstrap the buildpack!
RUN /tmp/buildpack/php/bin/compile /app /tmp/build_cache /tmp/env

The same Dockerfile works for 18 and 20 (just replacing their versions in the ENV and the image name).

Did anything change in the process for 22 that we need to deal with?

ADD https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/$PHP_BUILDPACK_FILE ./

This is the old S3 bucket - try:
https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/php.tgz

(Though checking the Last-Modified I see the sync service to the old bucket still seems to be working, so likely not the cause; however best to switch over to the new bucket since we'll be switching off the sync service soon.)

FROM heroku/heroku:22

On Heroku, the builds occur in the build image variant, not the runtime variant. ie: For full parity, you need to use heroku/heroku:22-build (though if the builds work, using the slimmer heroku/heroku:22 image will be quicker).

That said, I suspect the issue might be due to a strange issue we encountered when upgrading some CI pipelines - whereby curl calls would fail on Ubuntu 22.04 with:
curl: (6) getaddrinfo() thread failed to start

The solution for us turned out to be to update to a newer version of Docker on the host. (In our case, that meant specifying an explicit Docker version to Circle CI's setup_remote_docker feature, since it defaults to a really old Docker).