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

Arm64 support for reportportal/migrations container image #305

Open
banbone opened this issue May 17, 2024 · 0 comments
Open

Arm64 support for reportportal/migrations container image #305

banbone opened this issue May 17, 2024 · 0 comments

Comments

@banbone
Copy link

banbone commented May 17, 2024

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:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant