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 b436a63
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/intermediate-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ defaults:
working-directory: "build/dockerfiles/intermediate"

jobs:
build-and-publish-intermediate:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -86,14 +86,42 @@ jobs:
else
echo "no BASE_IMAGE match"
fi
- name: Build image
id: build
build-and-publish-intermediate-amd64:
runs-on: ubuntu-latest
needs: setup
env:
PLATFORM: arm64
steps:
- 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 }}
build-and-publish-intermediate-arm64:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Build arm64 image
id: build-arm64
uses: docker/build-push-action@v5
env:
PLATFORM: arm64
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 b436a63

Please sign in to comment.