Server: Trying to build ARM64 Docker image

pull/12036/head
Laurent Cozic 2025-03-30 18:50:57 +02:00
parent c921976e9d
commit e74d5e7c23
3 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
echo "GIT_TAG_NAME=$GIT_TAG_NAME"
echo "SERVER_TAG_PREFIX=$SERVER_TAG_PREFIX"
echo "SERVER_REPOSITORY=$SERVER_REPOSITORY"
# Check if it's a server release, otherwise exit
if [[ $GIT_TAG_NAME != $SERVER_TAG_PREFIX-* ]]; then
exit 0
fi
docker manifest create $SERVER_REPOSITORY:$GIT_TAG_NAME \
$SERVER_REPOSITORY:arm64-$GIT_TAG_NAME \
$SERVER_REPOSITORY:amd64-$GIT_TAG_NAME
docker manifest annotate $SERVER_REPOSITORY:$GIT_TAG_NAME $SERVER_REPOSITORY:arm64-$GIT_TAG_NAME --arch arm64
docker manifest annotate $SERVER_REPOSITORY:$GIT_TAG_NAME $SERVER_REPOSITORY:amd64-$GIT_TAG_NAME --arch amd64
docker manifest push $SERVER_REPOSITORY:$GIT_TAG_NAME

View File

@ -84,6 +84,14 @@ jobs:
run: |
yarn install && cd packages/app-desktop && yarn dist --publish=never
- name: Publish Docker manifest
if: runner.os == 'Linux'
env:
SERVER_REPOSITORY: joplin/server
SERVER_TAG_PREFIX: server
run: |
"${GITHUB_WORKSPACE}/.github/scripts/publish_docker_manifest.sh"
ServerDockerImage:
if: github.repository == 'laurent22/joplin'
runs-on: ${{ matrix.os }}

View File

@ -87,6 +87,7 @@ async function main() {
const tagName = argv.tagName || `server-${await execCommand('git describe --tags --match v*', { showStdout: false })}`;
const platform = argv.platform;
const source = argv.source;
const architecture = argv.platform.split('/')[1];
const isPreRelease = getIsPreRelease(tagName);
const imageVersion = getVersionFromTag(tagName, isPreRelease);
@ -132,7 +133,7 @@ async function main() {
const cliArgs = ['--progress=plain'];
cliArgs.push(`--platform ${platform}`);
cliArgs.push(...dockerTags.map(tag => `--tag "${repository}:${tag}"`));
cliArgs.push(...dockerTags.map(tag => `--tag "${repository}:${architecture}-${tag}"`));
cliArgs.push(...buildArgs.map(arg => `--build-arg ${arg}`));
if (pushImages) {
cliArgs.push('--push');