Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Arm64 compatible images #2125

Merged
merged 11 commits into from
Apr 12, 2021
63 changes: 63 additions & 0 deletions .github/workflows/test-docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
#
name: Test docker multiarch build

# Trigger the workflow's on all PRs and pushes so that other contributors can
# run tests in their own forks. Avoid triggering these tests on changes to
# documentation only changes.
on:
pull_request:
paths-ignore:
- "doc/**"
- "**/test-docs.yaml"
- "**.md"
- "**/schema.yaml"
push:
paths-ignore:
- "doc/**"
- "**/test-docs.yaml"
- "**.md"
- "**/schema.yaml"
branches-ignore:
- "dependabot/**"
workflow_dispatch:

jobs:
# TODO: this is just a quick test to check the arm64 docker images
# Based on
# https://github.com/docker/build-push-action/blob/v2.3.0/docs/advanced/local-registry.md
# https://github.com/docker/build-push-action/blob/v2.3.0/docs/advanced/multi-platform.md
build_images:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"

# https://github.com/jupyterhub/chartpress/pull/124
- name: Install chartpress buildx-platforms-dev version
run: pip install --no-cache-dir chartpress@git+https://github.com/manics/chartpress.git@buildx-platforms-skip

consideRatio marked this conversation as resolved.
Show resolved Hide resolved
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# https://github.com/docker/login-action/tree/v1.8.0#github-container-registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push to local registry
run: >-
chartpress --push --tag dev
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
--builder docker-buildx
--platform linux/amd64 --platform linux/arm64
--image-prefix ghcr.io/${{ github.repository_owner }}/z2jh-
3 changes: 3 additions & 0 deletions chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ charts:
valuesPath: prePuller.hook.image

# singleuser-sample, a primitive user container to start with.
# Image is based on https://github.com/jupyter/docker-stacks/ which is amd64 only
singleuser-sample:
valuesPath: singleuser.image
skipPlatforms:
- linux/arm64
9 changes: 8 additions & 1 deletion images/hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8
RUN apt-get update && \

# psycopg2-binary in requirements.txt is not compiled for linux/arm64
# TODO: Use build stages to compile psycopg2-binary separately instead of
# bloating the image size
RUN EXTRA_APT_PACKAGES=; \
if [ `uname -m` != 'x86_64' ]; then EXTRA_APT_PACKAGES=libpq-dev; fi; \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
vim \
Expand All @@ -20,6 +26,7 @@ RUN apt-get update && \
sqlite3 \
curl \
dnsutils \
$EXTRA_APT_PACKAGES \
&& \
rm -rf /var/lib/apt/lists/*

Expand Down
5 changes: 4 additions & 1 deletion images/secret-sync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ FROM python:3.8-alpine
# VULN_SCAN_TIME=2021-03-27_00:01:53

# Note that we use tini-static, it embeds dependencies missing in alpine
RUN wget -qO /tini https://github.com/krallin/tini/releases/download/v0.19.0/tini-static \
RUN ARCH=`uname -m`; date; \
if [ "$ARCH" = x86_64 ]; then ARCH=amd64; fi; \
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi; \
wget -qO /tini "https://github.com/krallin/tini/releases/download/v0.19.0/tini-static-$ARCH" \
&& chmod +x /tini

# Ensures written logs are made available directly
Expand Down