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

Multi-arch container image #262

Open
lizrice opened this issue Sep 29, 2023 · 3 comments
Open

Multi-arch container image #262

lizrice opened this issue Sep 29, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@lizrice
Copy link
Member

lizrice commented Sep 29, 2023

The container image is currently x86 only, would be great to have a multi-arch image so people can easily run as a container on ARM platforms as well

@brb brb added the help wanted Extra attention is needed label Sep 29, 2023
@lizrice
Copy link
Member Author

lizrice commented Sep 29, 2023

This is not a full solution but maybe points in a useful direction: I was able to make some small changes to the Dockerfile to get a multi-arch image that works on my ARM Mac at least.

FROM --platform=$TARGETPLATFORM ubuntu:22.04 AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
ARG BUILDARCH
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log

ENV PATH $PATH:/usr/local/go/bin

RUN apt update -y -q && \
    DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -q \
        curl \
        build-essential \
        ca-certificates \
        wget \
        gnupg2 \
        git \
        llvm \
        clang \
        gcc flex bison gcc-aarch64* libc6-dev-arm64-cross
RUN curl -s https://storage.googleapis.com/golang/go1.20.5.linux-$TARGETARCH.tar.gz | tar -v -C /usr/local -xz

WORKDIR /pwru
COPY . .
RUN TARGET_GOARCH=${TARGETARCH} GOARCH=${BUILDARCH} make 
RUN chmod a+x /pwru

FROM --platform=$TARGETPLATFORM busybox
COPY --from=build /pwru/pwru /usr/local/bin/

Using a Docker container driver I can locally build and push a multi-arch image like this: docker buildx build --platform linux/amd64,linux/arm64 --tag <owner>/pwru --push . (kinda slowly due to QEMU). But I couldn't quickly see a script or action or something that could be updated to run this build

@mstrYoda
Copy link

mstrYoda commented Mar 18, 2024

Are there any progress on here? Would love to see official arm64 image.

Btw @lizrice, I needed to change https://storage.googleapis.com/golang/go1.20.5.linux-$TARGETARCH to https://storage.googleapis.com/golang/go1.21.0.linux-$TARGETARCH otherwise I got error about go toolchain (go.mod line 3).

@brb
Copy link
Member

brb commented Mar 22, 2024

Thanks for asking, but unfortunately no progress. We would love to see a contribution for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants