Skip to content

Commit

Permalink
Merge pull request #24 from NordSecurity/LLT-5248-buildx-for-x86-and-…
Browse files Browse the repository at this point in the history
…arm-linux

Build docker containers build-linux-rust and build-linux-rust for linux/arm64
  • Loading branch information
tomaszklak authored Jul 2, 2024
2 parents bdea1ab + b567973 commit 59275fe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,22 @@ 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: |-
${{ (github.event.inputs.name == 'build-linux-rust' || github.event.inputs.name == 'build-windows-rust') && 'linux/amd64,linux/arm64' ||
'linux/amd64' }}
push: true
tags: ${{ env.REGISTRY }}/nordsecurity/${{ inputs.name }}${{ inputs.rust_version }}:${{ inputs.version }}
build-args: |
Expand Down Expand Up @@ -77,12 +88,23 @@ 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.name == 'build-linux-rust' || matrix.name == 'build-windows-rust') && 'linux/amd64,linux/arm64' ||
'linux/amd64' }}
push: true
tags: ${{ env.REGISTRY }}/nordsecurity/debug-${{ matrix.name }}:${{ github.sha }}
tags: ${{ env.REGISTRY }}/nordsecurity/${{ matrix.name }}:debug-${{ github.sha }}
build-args: |
REVISION=${{ github.sha }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release notes

## 3.3.0
- 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 59275fe

Please sign in to comment.