Skip to content

Commit a64a5da

Browse files
authored
Merge pull request #823 from linuxserver/template-multi
add multi-arch support to template
2 parents cc80a43 + c3f81ed commit a64a5da

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.github/workflows/BuildImage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
ENDPOINT: "linuxserver/mods" #don't modify
88
BASEIMAGE: "replace_baseimage" #replace
99
MODNAME: "replace_modname" #replace
10+
MULTI_ARCH: "false" #set to true if needed
1011

1112
jobs:
1213
set-vars:
@@ -19,6 +20,7 @@ jobs:
1920
echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
2021
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
2122
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
23+
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
2224
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
2325
MOD_VERSION=""
2426
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
@@ -27,6 +29,7 @@ jobs:
2729
ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }}
2830
BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }}
2931
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
32+
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
3033
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
3134

3235
build:
@@ -42,4 +45,5 @@ jobs:
4245
ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }}
4346
BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }}
4447
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
48+
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
4549
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}

Dockerfile.complex

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
# syntax=docker/dockerfile:1
22

33
## Buildstage ##
4-
FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage
4+
FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as buildstage
55

66
RUN \
77
echo "**** install packages ****" && \
88
apk add --no-cache \
99
curl && \
1010
echo "**** grab rclone ****" && \
1111
mkdir -p /root-layer && \
12-
curl -o \
13-
/root-layer/rclone.deb -L \
14-
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb"
12+
if [ $(uname -m) = "x86_64" ]; then \
13+
echo "Downloading x86_64 tarball" && \
14+
curl -o \
15+
/root-layer/rclone.deb -L \
16+
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb"; \
17+
elif [ $(uname -m) = "aarch64" ]; then \
18+
echo "Downloading aarch64 tarball" && \
19+
curl -o \
20+
/root-layer/rclone.deb -L \
21+
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-arm64.deb"; \
22+
fi && \
1523

1624
# copy local files
1725
COPY root/ /root-layer/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If adding multiple mods, enter them in an array separated by `|`, such as `DOCKE
1313
* Inspect the `root` folder contents. Edit, add and remove as necessary.
1414
* After all init scripts and services are created, run `find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} +` to fix permissions.
1515
* Edit this readme with pertinent info, delete these instructions.
16-
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic if needed.
16+
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed.
1717
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
1818
* Submit PR against the branch created by the team.
1919

0 commit comments

Comments
 (0)