add multi-arch support to template

This commit is contained in:
aptalca
2024-01-24 18:20:05 -05:00
parent cc80a43d42
commit 00d5edca06
3 changed files with 17 additions and 5 deletions
+4
View File
@@ -7,6 +7,7 @@ env:
ENDPOINT: "linuxserver/mods" #don't modify ENDPOINT: "linuxserver/mods" #don't modify
BASEIMAGE: "replace_baseimage" #replace BASEIMAGE: "replace_baseimage" #replace
MODNAME: "replace_modname" #replace MODNAME: "replace_modname" #replace
MULTI_ARCH: "false" #set to true if needed
jobs: jobs:
set-vars: set-vars:
@@ -19,6 +20,7 @@ jobs:
echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT echo "ENDPOINT=${{ env.ENDPOINT }}" >> $GITHUB_OUTPUT
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. **** # **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
MOD_VERSION="" MOD_VERSION=""
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
@@ -27,6 +29,7 @@ jobs:
ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }} ENDPOINT: ${{ steps.outputs.outputs.ENDPOINT }}
BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }} BASEIMAGE: ${{ steps.outputs.outputs.BASEIMAGE }}
MODNAME: ${{ steps.outputs.outputs.MODNAME }} MODNAME: ${{ steps.outputs.outputs.MODNAME }}
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }} MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
build: build:
@@ -42,4 +45,5 @@ jobs:
ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }} ENDPOINT: ${{ needs.set-vars.outputs.ENDPOINT }}
BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }} BASEIMAGE: ${{ needs.set-vars.outputs.BASEIMAGE }}
MODNAME: ${{ needs.set-vars.outputs.MODNAME }} MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }} MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
+12 -4
View File
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
## Buildstage ## ## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-alpine:3.17 as buildstage FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as buildstage
RUN \ RUN \
echo "**** install packages ****" && \ echo "**** install packages ****" && \
@@ -9,9 +9,17 @@ RUN \
curl && \ curl && \
echo "**** grab rclone ****" && \ echo "**** grab rclone ****" && \
mkdir -p /root-layer && \ mkdir -p /root-layer && \
curl -o \ if [[ $(uname -m) == "x86_64" ]]; then \
/root-layer/rclone.deb -L \ echo "Downloading x86_64 tarball" && \
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb" curl -o \
/root-layer/rclone.deb -L \
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-amd64.deb"; \
elif [[ $(uname -m) == "aarch64" ]]; then \
echo "Downloading aarch64 tarball" && \
curl -o \
/root-layer/rclone.deb -L \
"https://downloads.rclone.org/v1.47.0/rclone-v1.47.0-linux-arm64.deb"; \
fi && \
# copy local files # copy local files
COPY root/ /root-layer/ COPY root/ /root-layer/
+1 -1
View File
@@ -13,7 +13,7 @@ If adding multiple mods, enter them in an array separated by `|`, such as `DOCKE
* Inspect the `root` folder contents. Edit, add and remove as necessary. * Inspect the `root` folder contents. Edit, add and remove as necessary.
* 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. * 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.
* Edit this readme with pertinent info, delete these instructions. * Edit this readme with pertinent info, delete these instructions.
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic if needed. * Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed.
* 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. * 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.
* Submit PR against the branch created by the team. * Submit PR against the branch created by the team.