mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-05-13 05:52:04 +00:00
Merge pull request #1700 from oceanapplications/master
chore(server): port shadowbox Docker image to arm64
This commit is contained in:
commit
38eca18e93
3 changed files with 57 additions and 5 deletions
42
.github/workflows/build_and_test_debug.yml
vendored
42
.github/workflows/build_and_test_debug.yml
vendored
|
|
@ -43,8 +43,16 @@ jobs:
|
|||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: false
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
|
||||
|
||||
- name: Lint
|
||||
run: ./task lint
|
||||
|
|
@ -81,6 +89,40 @@ jobs:
|
|||
files: |
|
||||
src/shadowbox/server/api.yml
|
||||
|
||||
shadowbox-arm64:
|
||||
name: Shadowbox (arm64)
|
||||
runs-on: ubuntu-22.04-arm
|
||||
needs: lint
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: false
|
||||
|
||||
- name: Install NPM Dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
|
||||
|
||||
- name: Shadowbox Debug Build (arm64)
|
||||
run: TARGET_ARCH=aarch64 ./task shadowbox:build
|
||||
|
||||
- name: Shadowbox Unit Test
|
||||
run: ./task shadowbox:test
|
||||
|
||||
- name: Shadowbox Docker Build (arm64)
|
||||
run: TARGET_ARCH=aarch64 ./task shadowbox:docker:build
|
||||
|
||||
manual-install-script:
|
||||
name: Manual Install Script
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -456,8 +456,8 @@ function set_hostname() {
|
|||
install_shadowbox() {
|
||||
local MACHINE_TYPE
|
||||
MACHINE_TYPE="$(uname -m)"
|
||||
if [[ "${MACHINE_TYPE}" != "x86_64" ]]; then
|
||||
log_error "Unsupported machine type: ${MACHINE_TYPE}. Please run this script on a x86_64 machine"
|
||||
if [[ "${MACHINE_TYPE}" != "x86_64" && "${MACHINE_TYPE}" != "aarch64" && "${MACHINE_TYPE}" != "arm64" ]]; then
|
||||
log_error "Unsupported machine type: ${MACHINE_TYPE}. Supported architectures: x86_64, aarch64/arm64."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ tasks:
|
|||
vars:
|
||||
TARGET_OS: '{{.TARGET_OS | default "linux"}}'
|
||||
TARGET_ARCH: '{{.TARGET_ARCH | default "x86_64"}}'
|
||||
GOARCH: '{{get (dict "x86_64" "amd64") .TARGET_ARCH | default .TARGET_ARCH}}'
|
||||
GOARCH: '{{get (dict "x86_64" "amd64" "aarch64" "arm64") .TARGET_ARCH | default .TARGET_ARCH}}'
|
||||
TARGET_DIR: '{{.TARGET_DIR | default (joinPath .OUTPUT_BASE .TARGET_OS .TARGET_ARCH)}}'
|
||||
NODE_DIR: '{{joinPath .TARGET_DIR "app"}}'
|
||||
BIN_DIR: '{{joinPath .TARGET_DIR "bin"}}'
|
||||
|
|
@ -79,10 +79,19 @@ tasks:
|
|||
# Newer node images have no valid content trust data.
|
||||
# Pin the image node:16.18.0-alpine3.16 by hash.
|
||||
# See image at https://hub.docker.com/_/node/tags?page=1&name=18.18.0-alpine3.18
|
||||
# Note: "aarch64" is an alias for "arm64" — Linux ARM64 hosts report "aarch64" via uname -m.
|
||||
NODE_IMAGE: '{{get
|
||||
(dict
|
||||
"x86_64" "node@sha256:a0b787b0d53feacfa6d606fb555e0dbfebab30573277f1fe25148b05b66fa097"
|
||||
"arm64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
|
||||
"x86_64" "node@sha256:a0b787b0d53feacfa6d606fb555e0dbfebab30573277f1fe25148b05b66fa097"
|
||||
"arm64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
|
||||
"aarch64" "node@sha256:b4b7a1dd149c65ee6025956ac065a843b4409a62068bd2b0cbafbb30ca2fab3b"
|
||||
) .TARGET_ARCH
|
||||
}}'
|
||||
DOCKER_PLATFORM: '{{get
|
||||
(dict
|
||||
"x86_64" "linux/amd64"
|
||||
"arm64" "linux/arm64"
|
||||
"aarch64" "linux/arm64"
|
||||
) .TARGET_ARCH
|
||||
}}'
|
||||
env:
|
||||
|
|
@ -103,6 +112,7 @@ tasks:
|
|||
# Build image with given root
|
||||
- |
|
||||
"${DOCKER:-docker}" build --force-rm \
|
||||
--platform '{{.DOCKER_PLATFORM}}' \
|
||||
--build-arg NODE_IMAGE='{{.NODE_IMAGE}}' \
|
||||
--build-arg VERSION='{{.VERSION}}' \
|
||||
-f '{{joinPath .TASKFILE_DIR "docker" "Dockerfile"}}' \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue