Skip to content

Commit

Permalink
Build docker containers build-linux-rust and build-linux-rust for lin…
Browse files Browse the repository at this point in the history
…ux/arm64
  • Loading branch information
tomaszklak committed Jun 12, 2024
1 parent bdea1ab commit 1c36ed3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
42 changes: 36 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ on:
- build-windows-rust
- package-aar
- package-aar-jdk-17
platforms:
type: choice
required: true
description: Docker container platform
options:
- "linux/amd64"
- "linux/amd64,linux/arm64"
version:
type: string
required: true
Expand Down Expand Up @@ -44,11 +51,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: builders/${{ inputs.name }}/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ env.REGISTRY }}/nordsecurity/${{ inputs.name }}${{ inputs.rust_version }}:${{ inputs.version }}
build-args: |
Expand All @@ -58,12 +74,17 @@ jobs:
if: github.event_name == 'push'
strategy:
matrix:
name:
- build-android-rust
- build-linux-rust
- build-windows-rust
- package-aar
- package-aar-jdk-17
include:
- name: build-android-rust
platforms: "linux/amd64"
- name: build-linux-rust
platforms: "linux/amd64,linux/arm64"
- name: build-windows-rust
platforms: "linux/amd64,linux/arm64"
- name: package-aar
platforms: "linux/amd64"
- name: package-aar-jdk-17
platforms: "linux/amd64"
runs-on: ubuntu-22.04
permissions:
packages: write
Expand All @@ -77,11 +98,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: builders/${{ matrix.name }}/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ env.REGISTRY }}/nordsecurity/debug-${{ matrix.name }}:${{ github.sha }}
build-args: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release notes

## Unreleased
- build-linux-rust and build-linux-rust are now built also for linux/arm64

## 3.2.0
- Add `python-requests` to Docker images
- Allow uniffi gnerator to run outside docker
Expand Down
13 changes: 11 additions & 2 deletions builders/build-linux-rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ COPY --from=ghcr.io/nordsecurity/uniffi-generators:v0.25.0-8 /bin/uniffi-bindgen
COPY --from=ghcr.io/nordsecurity/uniffi-generators:v0.25.0-8 /bin/uniffi-bindgen-go /bin
COPY --from=ghcr.io/nordsecurity/uniffi-generators:v0.25.0-8 /bin/uniffi-bindgen-cpp /bin

# Multilib is not present in an arm64 debian but is used by libtelio
RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get update; \
if apt-cache show gcc-10-multilib > /dev/null 2>&1; then \
apt-get install -y gcc-10-multilib; \
else \
echo "Package gcc-10-multilib does not exist. Skipping installation."; \
fi; \
rm -rf /var/lib/apt/lists/*

RUN set -eux; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get update; \
apt-get install -y \
# `g++-*` is used by libnudler
# `gcc-10-multilib` is used by libtelio
g++-aarch64-linux-gnu \
g++-arm-linux-gnueabi \
g++-arm-linux-gnueabihf \
g++-i686-linux-gnu \
gcc-10-multilib \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf \
Expand Down

0 comments on commit 1c36ed3

Please sign in to comment.