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 47fc0cb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/intermediate-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,33 @@ jobs:
else
echo "no BASE_IMAGE match"
fi
- name: Build image
- name: Build amd64 image
id: build
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/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 }}
PLATFORM="amd64"
- name: Build arm64 image
id: build
uses: docker/build-push-action@v5
with:
context: .
push: true
file: build/dockerfiles/intermediate/${{ github.event.inputs.BASE_IMAGE }}.Dockerfile
platforms: linux/arm64
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 }}
PLATFORM="arm64"
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 47fc0cb

Please sign in to comment.