Skip to content

Commit

Permalink
add support for arm64 for go image
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Apr 26, 2024
1 parent cc88e8e commit 146af19
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/intermediate-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,36 @@ jobs:
else
echo "no BASE_IMAGE match"
fi
- name: Build image
id: build
- name: Set env PLATFORM to amd64
run: PLATFORM="amd64"

- name: Build amd64 image
id: build-amd64
uses: docker/build-push-action@v5
with:
context: .
push: true
file: build/dockerfiles/intermediate/${{ github.event.inputs.BASE_IMAGE }}.Dockerfile
platforms: linux/amd64
tags: scrolltech/${{ github.event.inputs.BASE_IMAGE }}:${{ env.TAG }}
build-args: |
CUDA_VERSION=${{ github.event.inputs.CUDA_VERSION }}
GO_VERSION=${{ github.event.inputs.GO_VERSION }}
RUST_VERSION=${{ github.event.inputs.RUST_VERSION }}
PYTHON_VERSION=${{ github.event.inputs.PYTHON_VERSION }}
- name: Set env PLATFORM to amd64
run: PLATFORM="arm64"

- name: Build arm64 image
id: build-arm64
uses: docker/build-push-action@v5
with:
context: .
push: true
file: build/dockerfiles/intermediate/${{ github.event.inputs.BASE_IMAGE }}.Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
tags: scrolltech/${{ github.event.inputs.BASE_IMAGE }}:${{ env.TAG }}
build-args: |
CUDA_VERSION=${{ github.event.inputs.CUDA_VERSION }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN cargo install cargo-chef --locked --version ${CARGO_CHEF_TAG} \
# Install Go
ARG GO_VERSION
RUN rm -rf /usr/local/go
RUN wget https://go.dev/dl/go${GO_VERSION}.1.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go${GO_VERSION}.1.linux-amd64.tar.gz
RUN rm go${GO_VERSION}.1.linux-amd64.tar.gz
RUN wget https://go.dev/dl/go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
RUN tar -C /usr/local -xzf go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
RUN rm go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
6 changes: 3 additions & 3 deletions build/dockerfiles/intermediate/go-rust-builder.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN cargo install cargo-chef --locked --version ${CARGO_CHEF_TAG} \
# Install Go
ARG GO_VERSION
RUN rm -rf /usr/local/go
RUN wget https://go.dev/dl/go${GO_VERSION}.1.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go${GO_VERSION}.1.linux-amd64.tar.gz
RUN rm go${GO_VERSION}.1.linux-amd64.tar.gz
RUN wget https://go.dev/dl/go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
RUN tar -C /usr/local -xzf go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
RUN rm go${GO_VERSION}.1.linux-${PLATFORM}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

0 comments on commit 146af19

Please sign in to comment.