-
Notifications
You must be signed in to change notification settings - Fork 15
Description
I'm trying to run the reportportal/migrations image on an arm64 node in my k8s cluster. Receiving errors:
/bin/sh ./entrypoint.sh: exec format error
I'm using the arm64 digest of the image available on dockerhub, and i can verify that the node that the pod is assigned to is the correct architecture for this image.
The dockerfile here seems to contain a bug:
Line 4 in cca0e98
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.tar.gz | tar xvz && \ |
Even when building the arm64 variant of the image, it's still retrieving the amd64 version of the golang-migrate binary. As this is directly called by the ./entrypoint.sh
, I believe this to be the problem. (I tried opening a pr but permission denied eh)
My suggestion would be to update the Dockerfile like so:
FROM --platform=${BUILDPLATFORM} alpine:latest
ARG TARGETARCH
ENV ARCH=$TARGETARCH
ENV POSTGRES_SSLMODE="disable"
RUN apk --no-cache add curl bash && \
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-${ARCH}.tar.gz | tar xvz && \
mv migrate /usr/local/bin/migrate && \
chmod +x /usr/local/bin/migrate
ADD "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" /wait-for-it.sh
COPY entrypoint.sh /entrypoint.sh
COPY index-template-setup.sh /index-template-setup.sh
RUN chmod +x /entrypoint.sh && chmod +xr /wait-for-it.sh && chmod +x /index-template-setup.sh
COPY migrations/ /migrations/
ENTRYPOINT ["/entrypoint.sh"]
CMD ["up"]
The $TARGETARCH arg exposes the underlying container architecture as a variable, so this can be used to pull the appropriate binary from github.