Skip to content

Commit f9f1721

Browse files
committed
chore: add support for arm64
1 parent 0f74808 commit f9f1721

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ permissions:
2525

2626
jobs:
2727
release:
28-
runs-on: ubuntu-20.04
28+
strategy:
29+
matrix:
30+
os: ["ubuntu-22.04", "depot-ubuntu-22.04-arm"]
31+
include:
32+
- os: ubuntu-22.04
33+
arch: linux/amd64
34+
sha: cfce811006a27305071b1634ca8fe690392f5dcc205612e7b4e5bde411b7701e
35+
- os: depot-ubuntu-22.04-arm
36+
arch: linux/arm64
37+
sha: 4b475e7e7eed79708b2707a67d556a5d3c0bdaef0a1f341311d095d1b4b3e271
38+
runs-on: ${{ matrix.os }}
2939
steps:
3040
- name: Docker Login
3141
uses: docker/login-action@v2
@@ -64,7 +74,7 @@ jobs:
6474
git config --global user.name "Coder CI"
6575
6676
- name: Build Image
67-
run: make -j build/image/envbox
77+
run: make -j ARCH=${{ matrix.arch }} SYSBOX_SHA=${{ matrix.sha }} build/image/envbox
6878

6979
- name: Tag Image
7080
run: docker tag envbox ghcr.io/coder/envbox:${{ github.event.inputs.version }}

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
PROJECT_ROOT := $(shell git rev-parse --show-toplevel)
22
GO_FILES := $(shell git ls-files '*.go' '*.sum')
33
IMAGE_FILES := $(shell find deploy)
4+
ARCH ?= linux/amd64
5+
SYSBOX_SHA ?= cfce811006a27305071b1634ca8fe690392f5dcc205612e7b4e5bde411b7701e
46

57
.PHONY: clean
68
clean:
@@ -15,7 +17,7 @@ build/image/envbox: build/image/envbox/.ctx
1517
build/image/envbox/.ctx: build/envbox $(IMAGE_FILES)
1618
mkdir -p $(@D)
1719
cp -r build/envbox deploy/. $(@D)
18-
docker build -t envbox $(@D)
20+
docker buildx build --build-arg SYSBOX_SHA=$(SYSBOX_SHA) -t envbox --platform $(ARCH) $(@D)
1921
touch $@
2022

2123
.PHONY: fmt

deploy/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
# Ubuntu 20.04 LTS (Focal Fossa)
2-
FROM ubuntu:focal
1+
# Ubuntu 22.04 LTS (Jammy Jellyfish)
2+
FROM ubuntu:jammy
3+
4+
ARG TARGETARCH
5+
ARG SYSBOX_SHA="cfce811006a27305071b1634ca8fe690392f5dcc205612e7b4e5bde411b7701e"
6+
ARG SYSBOX_VERSION="0.6.3"
7+
ARG SYSBOX_DEB="sysbox-ce_$SYSBOX_VERSION-0.linux_$TARGETARCH.deb"
38

49
# Copy configuration files to appropriate locations
510
COPY files /
@@ -14,7 +19,7 @@ LABEL \
1419
ARG DEBIAN_FRONTEND=noninteractive
1520
# Pin docker to avoid any breaking API changes between the Go client and
1621
# the server.
17-
ARG DOCKER_VERSION="5:24.0.3-1~ubuntu.20.04~focal"
22+
ARG DOCKER_VERSION="5:24.0.3-1~ubuntu.22.04~jammy"
1823
# Ignore other repositories, as some require HTTPS
1924
RUN apt-get update --quiet --option Dir::Etc::SourceParts="" && \
2025
apt-get upgrade -y && \
@@ -46,10 +51,10 @@ RUN apt-get update --quiet --option Dir::Etc::SourceParts="" && \
4651
apt-get clean && \
4752
rm -rf /var/lib/apt/lists/*
4853

49-
RUN wget https://downloads.nestybox.com/sysbox/releases/v0.6.3/sysbox-ce_0.6.3-0.linux_amd64.deb && \
50-
echo "cfce811006a27305071b1634ca8fe690392f5dcc205612e7b4e5bde411b7701e sysbox-ce_0.6.3-0.linux_amd64.deb" | sha256sum --check --status && \
51-
apt install -y ./sysbox-ce_0.6.3-0.linux_amd64.deb && \
52-
rm ./sysbox-ce_0.6.3-0.linux_amd64.deb && \
54+
RUN wget https://downloads.nestybox.com/sysbox/releases/v$SYSBOX_VERSION/$SYSBOX_DEB && \
55+
echo "$SYSBOX_SHA $SYSBOX_DEB" | sha256sum --check --status && \
56+
apt install -y "./$SYSBOX_DEB" && \
57+
rm "./$SYSBOX_DEB" && \
5358
userdel -r sysbox
5459

5560
# This is jank but sysbox adds their own /etc/docker/daemon.json that overwrites ours when it gets installed,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
deb [signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable
1+
deb [signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable

0 commit comments

Comments
 (0)