Compare commits

..

No commits in common. "master" and "e8a2012f-ls3" have entirely different histories.

99 changed files with 1051 additions and 1523 deletions

View File

@ -15,6 +15,6 @@ trim_trailing_whitespace = false
indent_style = space
indent_size = 2
[{**.sh,root/etc/s6-overlay/s6-rc.d/**,root/etc/cont-init.d/**,root/etc/services.d/**}]
[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}]
indent_style = space
indent_size = 4

View File

@ -6,7 +6,7 @@
* Read, and fill the Pull Request template
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://linuxserver.io/discord)
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
## Common files
@ -105,10 +105,10 @@ docker build \
-t linuxserver/baseimage-arch:latest .
```
The ARM variants can be built on x86_64 hardware and vice versa using `lscr.io/linuxserver/qemu-static`
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
```bash
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
docker run --rm --privileged multiarch/qemu-user-static:register --reset
```
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.

View File

@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: Discord chat support
url: https://linuxserver.io/discord
url: https://discord.gg/YWrKVTn
about: Realtime support / chat with the community and the team.
- name: Discourse discussion forum

40
.github/ISSUE_TEMPLATE/issue.bug.md vendored Normal file
View File

@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
---
[linuxserverurl]: https://linuxserver.io
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
<!--- Provide a general summary of the bug in the Title above -->
------------------------------
## Expected Behavior
<!--- Tell us what should happen -->
## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Environment
**OS:**
**CPU architecture:** x86_64/arm32/arm64
**How docker service was installed:**
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Command used to create docker container (run/create/compose/screenshot)
<!--- Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container -->
## Docker logs
<!--- Provide a full docker log, output of "docker logs baseimage-arch" -->

View File

@ -1,68 +0,0 @@
# Based on the issue template
name: Bug report
description: Create a report to help us improve
title: "[BUG] <title>"
labels: [Bug]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: Tell us what happens instead of the expected behavior.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: Tell us what should happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **How docker service was installed**: distro's packagemanager
value: |
- OS:
- How docker service was installed:
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Docker creation
description: |
Command used to create docker container
Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container
render: bash
validations:
required: true
- type: textarea
attributes:
description: |
Provide a full docker log, output of "docker logs baseimage-arch"
label: Container logs
placeholder: |
Output of `docker logs baseimage-arch`
render: bash
validations:
required: true

25
.github/ISSUE_TEMPLATE/issue.feature.md vendored Normal file
View File

@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
---
[linuxserverurl]: https://linuxserver.io
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from --->
<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
<!--- Provide a general summary of the request in the Title above -->
------------------------------
## Desired Behavior
<!--- Tell us what should happen -->
## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
## Alternatives Considered
<!--- Tell us what other options you have tried or considered -->

View File

@ -1,31 +0,0 @@
# Based on the issue template
name: Feature request
description: Suggest an idea for this project
title: "[FEAT] <title>"
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Is this a new feature request?
description: Please search to see if a feature request already exists.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Wanted change
description: Tell us what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Reason for change
description: Justify your request, why do you want it, what is the benefit.
validations:
required: true
- type: textarea
attributes:
label: Proposed code change
description: Do you have a potential code change in mind?
validations:
required: false

View File

@ -1,19 +0,0 @@
name: Issue & PR Tracker
on:
issues:
types: [opened,reopened,labeled,unlabeled,closed]
pull_request_target:
types: [opened,reopened,review_requested,review_request_removed,labeled,unlabeled,closed]
pull_request_review:
types: [submitted,edited,dismissed]
permissions:
contents: read
jobs:
manage-project:
permissions:
issues: write
uses: linuxserver/github-workflows/.github/workflows/issue-pr-tracker.yml@v1
secrets: inherit

View File

@ -1,16 +0,0 @@
name: Mark stale issues and pull requests
on:
schedule:
- cron: '21 23 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
stale:
permissions:
issues: write
pull-requests: write
uses: linuxserver/github-workflows/.github/workflows/issues-cron.yml@v1
secrets: inherit

View File

@ -3,145 +3,14 @@ name: External Trigger Main
on:
workflow_dispatch:
permissions:
contents: read
jobs:
external-trigger-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v2.3.3
- name: External Trigger
if: github.ref == 'refs/heads/master'
env:
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
run: |
printf "# External trigger for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
if grep -q "^baseimage-arch_master_" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`baseimage-arch_master_\`; will skip trigger if version matches." >> $GITHUB_STEP_SUMMARY
elif grep -q "^baseimage-arch_master" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`baseimage-arch_master\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
exit 0
fi
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> External trigger running off of master branch. To disable this trigger, add \`baseimage-arch_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
EXT_RELEASE=$(echo $(date +%F))
echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY
if grep -q "^baseimage-arch_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
exit 0
fi
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
FAILURE_REASON="Can't retrieve external version for baseimage-arch branch master"
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-baseimage-arch/actions/runs/${{ github.run_id }}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
exit 1
fi
EXT_RELEASE_SANITIZED=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
echo "Sanitized external version: \`${EXT_RELEASE_SANITIZED}\`" >> $GITHUB_STEP_SUMMARY
echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY
image="linuxserver/baseimage-arch"
tag="latest"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fbaseimage-arch%3Apull" \
| jq -r '.token')
multidigest=$(curl -s \
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
--header "Accept: application/vnd.oci.image.index.v1+json" \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/manifests/${tag}")
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
# If there's a layer element it's a single-arch manifest so just get that digest
digest=$(jq -r '.config.digest' <<< "${multidigest}")
else
# Otherwise it's multi-arch or has manifest annotations
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
# Check for manifest annotations and delete if found
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
fi
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
# If there's still more than one digest, it's multi-arch
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
else
# Otherwise it's single arch
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
fi
if digest=$(curl -s \
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
digest=$(jq -r '.config.digest' <<< "${digest}");
fi
fi
image_info=$(curl -sL \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/blobs/${digest}")
if [[ $(echo $image_info | jq -r '.container_config') == "null" ]]; then
image_info=$(echo $image_info | jq -r '.config')
else
image_info=$(echo $image_info | jq -r '.container_config')
fi
IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}')
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
if [ -z "${IMAGE_VERSION}" ]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "Can't retrieve last pushed version, exiting" >> $GITHUB_STEP_SUMMARY
FAILURE_REASON="Can't retrieve last pushed version for baseimage-arch tag latest"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
exit 1
fi
echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY
if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then
echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY
exit 0
else
if [[ "${artifacts_found}" == "false" ]]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY
FAILURE_REASON="New version ${EXT_RELEASE} for baseimage-arch tag latest is detected, however not all artifacts are uploaded to upstream release yet. Will try again later."
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
else
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
echo "New sanitized version \`${EXT_RELEASE_SANITIZED}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
if [[ "${artifacts_found}" == "true" ]]; then
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
fi
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/master/buildWithParameters?PACKAGE_CHECK=false \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
sleep 10
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
buildurl="${buildurl%$'\r'}"
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
curl -iX POST \
"${buildurl}submitDescription" \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"
echo "**** Notifying Discord ****"
TRIGGER_REASON="A version change was detected for baseimage-arch tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE_SANITIZED}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
fi
fi
echo "**** No external release, exiting ****"
exit 0

View File

@ -2,47 +2,42 @@ name: External Trigger Scheduler
on:
schedule:
- cron: '39 * * * *'
- cron: '33 * * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
external-trigger-scheduler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v2.3.3
with:
fetch-depth: '0'
- name: External Trigger Scheduler
run: |
printf "# External trigger scheduler for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
for br in $(git for-each-ref --format='%(refname:lstrip=3)' refs/remotes)
echo "**** Branches found: ****"
git for-each-ref --format='%(refname:short)' refs/remotes
echo "**** Pulling the yq docker image ****"
docker pull ghcr.io/linuxserver/yq
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
do
if [[ "${br}" == "HEAD" ]]; then
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
continue
fi
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml)
ls_branch=$(echo "${ls_jenkins_vars}" | yq -r '.ls_branch')
ls_trigger=$(echo "${ls_jenkins_vars}" | yq -r '.external_type')
if [[ "${br}" == "${ls_branch}" ]] && [[ "${ls_trigger}" != "os" ]]; then
echo "Branch appears to be live and trigger is not os; checking workflow." >> $GITHUB_STEP_SUMMARY
br=$(echo "$br" | sed 's|origin/||g')
echo "**** Evaluating branch ${br} ****"
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml \
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
if [ "$br" == "$ls_branch" ]; then
echo "**** Branch ${br} appears to be live; checking workflow. ****"
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
echo "Triggering external trigger workflow for branch." >> $GITHUB_STEP_SUMMARY
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
curl -iX POST \
-H "Authorization: token ${{ secrets.CR_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"ref\":\"refs/heads/${br}\"}" \
https://api.github.com/repos/linuxserver/docker-baseimage-arch/actions/workflows/external_trigger.yml/dispatches
else
echo "Skipping branch due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
echo "**** Workflow doesn't exist; skipping trigger. ****"
fi
else
echo "Skipping branch due to being detected as dev branch or having no external version." >> $GITHUB_STEP_SUMMARY
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
fi
done

View File

@ -2,18 +2,12 @@ name: Greetings
on: [pull_request_target, issues]
permissions:
contents: read
jobs:
greeting:
permissions:
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
issue-message: 'Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.'
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }}

38
.github/workflows/package_trigger.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Package Trigger Main
on:
workflow_dispatch:
jobs:
package-trigger-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
- name: Package Trigger
if: github.ref == 'refs/heads/master'
run: |
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ARCH_MASTER }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ARCH_MASTER is set; skipping trigger. ****"
exit 0
fi
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
exit 0
fi
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BASEIMAGE_ARCH_MASTER\". ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/master/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
sleep 10
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
buildurl="${buildurl%$'\r'}"
echo "**** Jenkins job build url: ${buildurl} ****"
echo "**** Attempting to change the Jenkins job description ****"
curl -iX POST \
"${buildurl}submitDescription" \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"

View File

@ -2,102 +2,49 @@ name: Package Trigger Scheduler
on:
schedule:
- cron: '24 21 * * 6'
- cron: '55 13 * * 2'
workflow_dispatch:
permissions:
contents: read
jobs:
package-trigger-scheduler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v2.3.3
with:
fetch-depth: '0'
- name: Package Trigger Scheduler
env:
SKIP_PACKAGE_TRIGGER: ${{ vars.SKIP_PACKAGE_TRIGGER }}
run: |
printf "# Package trigger scheduler for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
for br in $(git for-each-ref --format='%(refname:lstrip=3)' refs/remotes)
echo "**** Branches found: ****"
git for-each-ref --format='%(refname:short)' refs/remotes
echo "**** Pulling the yq docker image ****"
docker pull ghcr.io/linuxserver/yq
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
do
if [[ "${br}" == "HEAD" ]]; then
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
continue
fi
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml)
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/Jenkinsfile >/dev/null 2>&1; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> No Jenkinsfile found. Branch is either deprecated or is an early dev branch." >> $GITHUB_STEP_SUMMARY
skipped_branches="${skipped_branches}${br} "
elif [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
echo "Branch appears to be live; checking workflow." >> $GITHUB_STEP_SUMMARY
README_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/readme-vars.yml)
if [[ $(yq -r '.project_deprecation_status' <<< "${README_VARS}") == "true" ]]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Branch appears to be deprecated; skipping trigger." >> $GITHUB_STEP_SUMMARY
skipped_branches="${skipped_branches}${br} "
elif [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Skipping branch ${br} due to \`skip_package_check\` being set in \`jenkins-vars.yml\`." >> $GITHUB_STEP_SUMMARY
skipped_branches="${skipped_branches}${br} "
elif grep -q "^baseimage-arch_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`baseimage-arch_${br}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
skipped_branches="${skipped_branches}${br} "
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/${br}/lastBuild/api/json | jq -r '.building' 2>/dev/null) == "true" ]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> There already seems to be an active build on Jenkins; skipping package trigger for ${br}" >> $GITHUB_STEP_SUMMARY
skipped_branches="${skipped_branches}${br} "
else
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
echo "> Triggering package trigger for branch ${br}" >> $GITHUB_STEP_SUMMARY
printf "> To disable, add \`baseimage-arch_%s\` into the Github organizational variable \`SKIP_PACKAGE_TRIGGER\`.\n\n" "${br}" >> $GITHUB_STEP_SUMMARY
br=$(echo "$br" | sed 's|origin/||g')
echo "**** Evaluating branch ${br} ****"
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml \
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
if [ "${br}" == "${ls_branch}" ]; then
echo "**** Branch ${br} appears to be live; checking workflow. ****"
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
triggered_branches="${triggered_branches}${br} "
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
if [[ -z "${response}" ]]; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Jenkins build could not be triggered. Skipping branch."
continue
fi
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
sleep 10
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
buildurl="${buildurl%$'\r'}"
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
if ! curl -ifX POST \
"${buildurl}submitDescription" \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"; then
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
echo "> Unable to change the Jenkins job description."
fi
sleep 20
curl -iX POST \
-H "Authorization: token ${{ secrets.CR_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"ref\":\"refs/heads/${br}\"}" \
https://api.github.com/repos/linuxserver/docker-baseimage-arch/actions/workflows/package_trigger.yml/dispatches
sleep 30
else
echo "**** Workflow doesn't exist; skipping trigger. ****"
fi
else
echo "Skipping branch ${br} due to being detected as dev branch." >> $GITHUB_STEP_SUMMARY
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
fi
done
if [[ -n "${triggered_branches}" ]] || [[ -n "${skipped_branches}" ]]; then
if [[ -n "${triggered_branches}" ]]; then
NOTIFY_BRANCHES="**Triggered:** ${triggered_branches} \n"
NOTIFY_BUILD_URL="**Build URL:** https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-baseimage-arch/activity/ \n"
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
fi
if [[ -n "${skipped_branches}" ]]; then
NOTIFY_BRANCHES="${NOTIFY_BRANCHES}**Skipped:** ${skipped_branches} \n"
fi
echo "**** Notifying Discord ****"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Package Check Build(s) for baseimage-arch** \n'"${NOTIFY_BRANCHES}"''"${NOTIFY_BUILD_URL}"'"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
fi
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
echo "**** Notifying Discord ****"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Package Check Build(s) Triggered for baseimage-arch** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-baseimage-arch/activity/"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

View File

@ -1,12 +0,0 @@
name: Permission check
on:
pull_request_target:
paths:
- '**/run'
- '**/finish'
- '**/check'
- 'root/migrations/*'
jobs:
permission_check:
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1

23
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Mark stale issues and pull requests
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
stale-issue-message: "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions."
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 30
days-before-close: 365
exempt-issue-labels: 'awaiting-approval,work-in-progress'
exempt-pr-labels: 'awaiting-approval,work-in-progress'
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,7 +1,38 @@
# syntax=docker/dockerfile:1
FROM alpine:3.14 as rootfs-stage
ARG ARCH_VERSION
# install packages
RUN \
apk add --no-cache \
bash \
curl \
jq \
tzdata \
xz
# grab latest rootfs
RUN \
echo "**** grab download URL ****" && \
if [ -z ${ARCH_VERSION+x} ]; then \
ARCH_VERSION=$(curl -sL https://gitlab.archlinux.org/api/v4/projects/10185/releases \
| jq -r '.[0].tag_name' | sed 's/^v//g'); \
fi && \
PACK_ID=$(curl -sL https://gitlab.archlinux.org/api/v4/projects/10185/packages?sort=desc | jq -r '.[] | select(.version == "'${ARCH_VERSION}'") | .id') && \
TAR_ID=$(curl -sL https://gitlab.archlinux.org/api/v4/projects/10185/packages/${PACK_ID}/package_files | jq '.[] | select(.file_name == "base-'${ARCH_VERSION}'.tar.xz") | .id') && \
echo "**** download/extract rootfs ****" && \
curl -o \
/rootfs.tar.xz -L \
https://gitlab.archlinux.org/archlinux/archlinux-docker/-/package_files/${TAR_ID}/download && \
mkdir /root-out && \
tar xf \
/rootfs.tar.xz -C \
/root-out
# pacstrap stage
FROM archlinux:base AS pacstrap-stage
FROM scratch as pacstrap-stage
COPY --from=rootfs-stage /root-out/ /
COPY patch/ /tmp/patch
RUN \
mkdir -m 0755 -p \
@ -12,19 +43,13 @@ RUN \
mkdir -m 0555 -p \
/root-out/{sys,proc} && \
pacman -r /root-out -Sy --noconfirm \
archlinux-keyring \
bash \
busybox \
catatonit \
coreutils \
curl \
findutils \
gawk \
grep \
gzip \
jq \
less \
netcat \
pacman \
procps-ng \
sed \
@ -35,71 +60,56 @@ RUN \
which && \
cp -a /etc/pacman.conf /root-out/etc/pacman.conf && \
cp -a /etc/pacman.d/mirrorlist /root-out/etc/pacman.d/mirrorlist && \
cp -a /tmp/patch/init-stage2.patch /root-out/ && \
rm /root-out/var/lib/pacman/sync/*
# set version for s6 overlay
ARG S6_OVERLAY_VERSION="3.2.1.0"
ARG S6_OVERLAY_ARCH="x86_64"
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz
# add s6 optional symlinks
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && unlink /root-out/usr/bin/with-contenv
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz
# runtime stage
FROM scratch
COPY --from=pacstrap-stage /root-out/ /
ARG BUILD_DATE
ARG VERSION
ARG MODS_VERSION="v3"
ARG PKG_INST_VERSION="v1"
ARG LSIOWN_VERSION="v1"
ARG WITHCONTENV_VERSION="v1"
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="TheLamer"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/with-contenv.${WITHCONTENV_VERSION}" "/usr/bin/with-contenv"
# set version for s6 overlay
ARG OVERLAY_VERSION="v2.2.0.3"
ARG OVERLAY_ARCH="amd64"
# environment variables
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
HOME="/root" \
TERM="xterm" \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \
S6_VERBOSITY=1 \
S6_STAGE2_HOOK=/docker-mods \
VIRTUAL_ENV=/lsiopy \
PATH="/lsiopy/bin:$PATH"
HOME="/root" \
TERM="xterm"
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer /tmp/
RUN \
echo "**** create abc user and make our folders ****" && \
groupadd -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults \
/lsiopy && \
/defaults && \
echo "**** install s6 ****" && \
chmod +x /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
/tmp/s6-overlay-${OVERLAY_ARCH}-installer / && \
rm /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** configure pacman ****" && \
locale-gen && \
pacman-key --init && \
pacman-key --populate archlinux && \
echo "**** configure locale ****" && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen && \
echo "**** patch files ****" && \
pacman -Sy --noconfirm \
patch && \
patch -u /etc/s6/init/init-stage2 -i /init-stage2.patch && \
echo "**** cleanup ****" && \
pacman -Rsn --noconfirm \
patch && \
rm -rf \
/init-stage2.patch \
/tmp/* \
/var/cache/pacman/pkg/* \
/var/lib/pacman/sync/*
# add local files

View File

@ -1,6 +1,4 @@
# syntax=docker/dockerfile:1
FROM alpine:3 AS rootfs-stage
FROM alpine:3.14 as rootfs-stage
# install packages
RUN \
@ -23,8 +21,9 @@ RUN \
/root-out
# pacstrap stage
FROM scratch AS pacstrap-stage
FROM scratch as pacstrap-stage
COPY --from=rootfs-stage /root-out/ /
COPY patch/ /tmp/patch
RUN \
mkdir -m 0755 -p \
@ -34,23 +33,16 @@ RUN \
/root-out/tmp && \
mkdir -m 0555 -p \
/root-out/{sys,proc} && \
sed -i 's/DownloadUser = alpm//g' /etc/pacman.conf && \
pacman-key --init && \
pacman-key --populate archlinuxarm && \
pacman -r /root-out -Sy --noconfirm \
archlinuxarm-keyring \
bash \
busybox \
catatonit \
coreutils \
curl \
findutils \
gawk \
grep \
gzip \
jq \
less \
netcat \
pacman \
procps-ng \
sed \
@ -61,74 +53,56 @@ RUN \
which && \
cp -a /etc/pacman.conf /root-out/etc/pacman.conf && \
cp -a /etc/pacman.d/mirrorlist /root-out/etc/pacman.d/mirrorlist && \
cp -a /etc/pacman.d/gnupg /root-out/etc/pacman.d/gnupg && \
cp -a /tmp/patch/init-stage2.patch /root-out/ && \
rm /root-out/var/lib/pacman/sync/*
# set version for s6 overlay
ARG S6_OVERLAY_VERSION="3.2.1.0"
ARG S6_OVERLAY_ARCH="aarch64"
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz
# add s6 optional symlinks
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && unlink /root-out/usr/bin/with-contenv
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz /tmp
RUN tar -C /root-out -Jxpf /tmp/s6-overlay-symlinks-arch.tar.xz
# runtime stage
FROM scratch
COPY --from=pacstrap-stage /root-out/ /
ARG BUILD_DATE
ARG VERSION
ARG MODS_VERSION="v3"
ARG PKG_INST_VERSION="v1"
ARG LSIOWN_VERSION="v1"
ARG WITHCONTENV_VERSION="v1"
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="TheLamer"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/package-install.${PKG_INST_VERSION}" "/etc/s6-overlay/s6-rc.d/init-mods-package-install/run"
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/with-contenv.${WITHCONTENV_VERSION}" "/usr/bin/with-contenv"
# set version for s6 overlay
ARG OVERLAY_VERSION="v2.2.0.3"
ARG OVERLAY_ARCH="aarch64"
# environment variables
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
HOME="/root" \
TERM="xterm" \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \
S6_VERBOSITY=1 \
S6_STAGE2_HOOK=/docker-mods \
VIRTUAL_ENV=/lsiopy \
PATH="/lsiopy/bin:$PATH"
HOME="/root" \
TERM="xterm"
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer /tmp/
RUN \
echo "**** create abc user and make our folders ****" && \
groupadd -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults \
/lsiopy && \
/defaults && \
echo "**** install s6 ****" && \
chmod +x /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
/tmp/s6-overlay-${OVERLAY_ARCH}-installer / && \
rm /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** configure pacman ****" && \
locale-gen && \
echo "**** configure locale ****" && \
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen && \
pacman-key --init && \
pacman-key --populate archlinuxarm && \
echo "**** patch files ****" && \
pacman -Sy --noconfirm \
patch && \
patch -u /etc/s6/init/init-stage2 -i /init-stage2.patch && \
echo "**** cleanup ****" && \
chmod 755 \
/etc \
/usr \
/usr/bin && \
pacman -Rsn --noconfirm \
patch && \
rm -rf \
/init-stage2.patch \
/tmp/* \
/var/cache/pacman/pkg/* \
/var/lib/pacman/sync/*
# add local files

111
Dockerfile.armhf Normal file
View File

@ -0,0 +1,111 @@
FROM alpine:3.14 as rootfs-stage
# install packages
RUN \
apk add --no-cache \
bash \
curl \
jq \
tzdata \
xz
# grab latest rootfs
RUN \
echo "**** download/extract rootfs ****" && \
curl -o \
/rootfs.tar.xz -L \
http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz && \
mkdir /root-out && \
tar xf \
/rootfs.tar.xz -C \
/root-out
# pacstrap stage
FROM scratch as pacstrap-stage
COPY --from=rootfs-stage /root-out/ /
COPY patch/ /tmp/patch
RUN \
mkdir -m 0755 -p \
/root-out/var/{cache/pacman/pkg,lib/pacman,log} \
/root-out/{dev,run,etc} && \
mkdir -m 1777 -p \
/root-out/tmp && \
mkdir -m 0555 -p \
/root-out/{sys,proc} && \
pacman-key --init && \
pacman-key --populate archlinuxarm && \
pacman -r /root-out -Sy --noconfirm \
bash \
coreutils \
findutils \
gawk \
grep \
gzip \
less \
pacman \
procps-ng \
sed \
shadow \
tar \
tzdata \
util-linux \
which && \
cp -a /etc/pacman.conf /root-out/etc/pacman.conf && \
cp -a /etc/pacman.d/mirrorlist /root-out/etc/pacman.d/mirrorlist && \
cp -a /tmp/patch/init-stage2.patch /root-out/ && \
rm /root-out/var/lib/pacman/sync/*
# runtime stage
FROM scratch
COPY --from=pacstrap-stage /root-out/ /
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="TheLamer"
# set version for s6 overlay
ARG OVERLAY_VERSION="v2.2.0.3"
ARG OVERLAY_ARCH="arm"
# environment variables
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
HOME="/root" \
TERM="xterm"
# add s6 overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer /tmp/
RUN \
echo "**** create abc user and make our folders ****" && \
groupadd -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
mkdir -p \
/app \
/config \
/defaults && \
echo "**** install s6 ****" && \
chmod +x /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
/tmp/s6-overlay-${OVERLAY_ARCH}-installer / && \
rm /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
mv /usr/bin/with-contenv /usr/bin/with-contenvb && \
echo "**** configure pacman ****" && \
locale-gen && \
pacman-key --init && \
pacman-key --populate archlinuxarm && \
echo "**** patch files ****" && \
pacman -Sy --noconfirm \
patch && \
patch -u /etc/s6/init/init-stage2 -i /init-stage2.patch && \
echo "**** cleanup ****" && \
pacman -Rsn --noconfirm \
patch && \
rm -rf \
/init-stage2.patch \
/tmp/* \
/var/lib/pacman/sync/*
# add local files
COPY root/ /
ENTRYPOINT ["/init"]

918
Jenkinsfile vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,29 @@
<!-- DO NOT EDIT THIS FILE MANUALLY -->
<!-- Please read https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/CONTRIBUTING.md -->
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
<!-- DO NOT EDIT THIS FILE MANUALLY -->
<!-- Please read the https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/CONTRIBUTING.md -->
[linuxserverurl]: https://linuxserver.io
[forumurl]: https://forum.linuxserver.io
[ircurl]: https://www.linuxserver.io/irc/
[appurl]: https://archlinux.org/
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png?v=4&s=4000)][linuxserverurl]
## Contact information:-
| Type | Address/Details |
| :---: | --- |
| Discord | [Discord](https://linuxserver.io/discord) |
| IRC | `#linuxserver.io` on irc.libera.chat |
| Forum | [Discourse](https://discourse.linuxserver.io/) |
| Discord | [Discord](https://discord.gg/YWrKVTn) |
| IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl]
| Forum | [LinuxServer.io forum][forumurl] |
A custom base image built with [Arch Linux](https://archlinux.org) and [s6-overlay](https://github.com/just-containers/s6-overlay).
&nbsp;
&nbsp;
- Support for using our base images in your own projects is provided on a Reasonable Endeavours basis, please see our [Support Policy](https://www.linuxserver.io/supportpolicy) for details.
- There is no `latest` tag for any of our base images, by design. We often make breaking changes between versions, and we don't publish release notes like we do for the downstream images.
- If you're intending to distribute an image using one of our bases, please read our [docs on container branding](https://docs.linuxserver.io/general/container-branding/) first.
[![](https://images.microbadger.com/badges/image/lsiobase/arch.svg)](https://microbadger.com/images/lsiobase/arch "Get your own image badge on microbadger.com")
[![](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/Dockerfile-Link-green.png)](https://github.com/linuxserver/docker-baseimage-arch/blob/master/Dockerfile)
A custom base image built with [Alpine linux][appurl] and [S6 overlay](https://github.com/just-containers/s6-overlay)..
The following line is only in this repo for loop testing:

View File

@ -2,13 +2,10 @@
# jenkins variables
project_name: docker-baseimage-arch
external_type: na
custom_version_command: "echo $(date +%F)"
external_type: os
release_type: stable
release_tag: latest
ls_branch: master
image_sbom: true
image_provenance: true
repo_vars:
- BUILD_VERSION_ARG = 'OS'
- LS_USER = 'linuxserver'
@ -24,6 +21,6 @@ repo_vars:
- CI_PORT='80'
- CI_SSL='true'
- CI_DELAY='30'
- CI_DOCKERENV='LSIO_FIRST_PARTY=true'
- CI_AUTH=''
- CI_DOCKERENV='TZ=US/Pacific'
- CI_AUTH='user:password'
- CI_WEBPATH=''

View File

@ -1,134 +1,80 @@
NAME VERSION TYPE
acl 2.3.2-1 alpm
archlinux-keyring 20260301-1 alpm
attr 2.5.2-1 alpm
audit 4.1.3-1 alpm
bash 5.3.9-1 alpm
binutils 2.46-1 alpm
brotli 1.2.0-1 alpm
busybox 1.36.1-2 alpm
bzip2 1.0.8-6 alpm
ca-certificates 20240618-1 alpm
ca-certificates-mozilla 3.121-1 alpm
ca-certificates-utils 20240618-1 alpm
catatonit 0.2.1-2 alpm
command-line-arguments UNKNOWN go-module
coreutils 9.10-1 alpm
cryptsetup 2.8.4-1 alpm
curl 8.18.0-3 alpm
dbus 1.16.2-1 alpm
dbus-broker 37-3 alpm
dbus-broker-units 37-3 alpm
dbus-units 37-3 alpm
device-mapper 2.03.38-1 alpm
e2fsprogs 1.47.3-2 alpm
expat 2.7.4-1 alpm
file 5.47-1 alpm
filesystem 2025.10.12-1 alpm
findutils 4.10.0-3 alpm
gawk 5.4.0-1 alpm
gcc-libs 15.2.1+r604+g0b99615a8aef-1 alpm
gdbm 1.26-2 alpm
gettext 1.0-2 alpm
glib2 2.86.4-1 alpm
glibc 2.43+r5+g856c426a7534-1 alpm
gmp 6.3.0-3 alpm
gnulib-l10n 20241231-1 alpm
gnupg 2.4.9-1 alpm
gnutls 3.8.12-2 alpm
gpgme 2.0.1-3 alpm
grep 3.12-2 alpm
gzip 1.14-2 alpm
hwdata 0.405-1 alpm
iana-etc 20260225-2 alpm
icu 78.2-2 alpm
jansson 2.15.0-1 alpm
jq 1.8.1-1 alpm
json-c 0.18-2 alpm
kbd 2.9.0-1 alpm
kernel.org/pub/linux/libs/security/libcap/cap v1.2.77 go-module
kernel.org/pub/linux/libs/security/libcap/psx v1.2.77 go-module
keyutils 1.6.3-3 alpm
kmod 34.2-1 alpm
krb5 1.21.3-2 alpm
leancrypto 1.6.0-1 alpm
less 1:692-1 alpm
libarchive 3.8.5-1 alpm
libasan 15.2.1+r604+g0b99615a8aef-1 alpm
libassuan 3.0.0-1 alpm
libatomic 15.2.1+r604+g0b99615a8aef-1 alpm
libbsd 0.12.2-2 alpm
libcap 2.77-1 alpm
libcap-ng 0.9-1 alpm
libelf 0.194-2 alpm
libevent 2.1.12-5 alpm
libffi 3.5.2-1 alpm
libgcc 15.2.1+r604+g0b99615a8aef-1 alpm
libgcrypt 1.12.1-1 alpm
libgfortran 15.2.1+r604+g0b99615a8aef-1 alpm
libgomp 15.2.1+r604+g0b99615a8aef-1 alpm
libgpg-error 1.59-1 alpm
libidn2 2.3.8-1 alpm
libksba 1.6.8-1 alpm
libldap 2.6.12-1 alpm
liblsan 15.2.1+r604+g0b99615a8aef-1 alpm
libmakepkg-dropins 20-1 alpm
libmd 1.1.0-2 alpm
libnghttp2 1.68.0-1 alpm
libnghttp3 1.15.0-1 alpm
libngtcp2 1.21.0-1 alpm
libnsl 2.0.1-1 alpm
libobjc 15.2.1+r604+g0b99615a8aef-1 alpm
libp11-kit 0.26.2-1 alpm
libpsl 0.21.5-2 alpm
libquadmath 15.2.1+r604+g0b99615a8aef-1 alpm
libsasl 2.1.28-5 alpm
libseccomp 2.6.0-1 alpm
libsecret 0.21.7-1 alpm
libssh2 1.11.1-1 alpm
libstdc++ 15.2.1+r604+g0b99615a8aef-1 alpm
libsysprof-capture 49.0-2 alpm
libtasn1 4.21.0-1 alpm
libtirpc 1.3.7-1 alpm
libtsan 15.2.1+r604+g0b99615a8aef-1 alpm
libubsan 15.2.1+r604+g0b99615a8aef-1 alpm
libunistring 1.4.1-1 alpm
libusb 1.0.29-1 alpm
libverto 0.3.2-5 alpm
libxcrypt 4.5.2-1 alpm
libxml2 2.15.2-1 alpm
linux-api-headers 6.19-1 alpm
lmdb 0.9.34-1 alpm
lz4 1:1.10.0-2 alpm
mpfr 4.2.2-1 alpm
ncurses 6.6-1 alpm
nettle 3.10.2-1 alpm
npth 1.8-1 alpm
oniguruma 6.9.10-1 alpm
openbsd-netcat 1.234_1-1 alpm
openssl 3.6.1-1 alpm
p11-kit 0.26.2-1 alpm
pacman 7.1.0.r9.g54d9411-1 alpm
pacman-mirrorlist 20260213-1 alpm
pam 1.7.2-2 alpm
pambase 20250719-1 alpm
pcre2 10.47-1 alpm
pinentry 1.3.2-2 alpm
popt 1.19-2 alpm
procps-ng 4.0.6-1 alpm
readline 8.3.003-1 alpm
sed 4.9-3 alpm
shadow 4.18.0-1 alpm
sqlite 3.51.2-1 alpm
stdlib go1.25.3 go-module
systemd 259.3-1 alpm
systemd-libs 259.3-1 alpm
tar 1.35-2 alpm
tpm2-tss 4.1.3-1 alpm
tzdata 2026a-1 alpm
util-linux 2.41.3-2 alpm
util-linux-libs 2.41.3-2 alpm
which 2.23-1 alpm
xz 5.8.2-1 alpm
zlib 1:1.3.2-2 alpm
zstd 1.5.7-3 alpm
acl 2.3.1-1
archlinux-keyring 20210802-1
attr 2.5.1-1
audit 3.0.3-1
bash 5.1.008-1
bzip2 1.0.8-4
ca-certificates 20210603-1
ca-certificates-mozilla 3.68-1
ca-certificates-utils 20210603-1
coreutils 8.32-1
curl 7.78.0-1
e2fsprogs 1.46.3-1
expat 2.4.1-1
file 5.40-5
filesystem 2021.05.31-1
findutils 4.8.0-1
gawk 5.1.0-1
gcc-libs 11.1.0-1
glib2 2.68.3-1
glibc 2.33-5
gmp 6.2.1-1
gnupg 2.2.29-1
gnutls 3.7.2-2
gpgme 1.16.0-1
grep 3.6-1
gzip 1.10-3
iana-etc 20210624-1
keyutils 1.6.3-1
krb5 1.19.1-1
less 1:590-1
libarchive 3.5.1-1
libassuan 2.5.5-1
libcap 2.51-1
libcap-ng 0.8.2-3
libffi 3.3-4
libgcrypt 1.9.3-1
libgpg-error 1.42-1
libidn2 2.3.2-1
libksba 1.6.0-1
libldap 2.4.59-2
libnghttp2 1.44.0-1
libp11-kit 0.24.0-1
libpsl 0.21.1-1
libsasl 2.1.27-3
libseccomp 2.5.1-2
libsecret 0.20.4-1
libssh2 1.9.0-3
libtasn1 4.17.0-1
libtirpc 1.3.2-1
libunistring 0.9.10-3
libxcrypt 4.4.23-1
linux-api-headers 5.12.3-1
lz4 1:1.9.3-2
mpfr 4.1.0-2
ncurses 6.2-2
nettle 3.7.3-1
npth 1.6-3
openssl 1.1.1.k-1
p11-kit 0.24.0-1
pacman 6.0.0-5
pacman-mirrorlist 20210718-1
pam 1.5.1-1
pambase 20210605-2
pcre 8.45-1
pcre2 10.37-1
pinentry 1.1.1-1
procps-ng 3.3.17-1
readline 8.1.001-1
sed 4.8-1
shadow 4.8.1-4
sqlite 3.36.0-1
systemd-libs 249.2-1
tar 1.34-1
tzdata 2021a-1
util-linux 2.37.1-1
util-linux-libs 2.37.1-1
which 2.21-5
xz 5.2.5-1
zlib 1:1.2.11-4
zstd 1.5.0-1

15
patch/init-stage2.patch Normal file
View File

@ -0,0 +1,15 @@
--- init-stage2 2021-01-20 20:21:41.628300700 -0600
+++ init-stage2_new 2021-01-20 20:23:48.123677700 -0600
@@ -17,6 +17,12 @@
backtick -D 0 -n S6_READ_ONLY_ROOT { printcontenv S6_READ_ONLY_ROOT }
importas -u S6_READ_ONLY_ROOT S6_READ_ONLY_ROOT
+# Docker Mods run logic
+foreground
+{
+ /docker-mods
+}
+
foreground
{
if

View File

@ -4,21 +4,29 @@
project_name: baseimage-arch
full_custom_readme: |
{% raw -%}
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
[linuxserverurl]: https://linuxserver.io
[forumurl]: https://forum.linuxserver.io
[ircurl]: https://www.linuxserver.io/irc/
[appurl]: https://archlinux.org/
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png?v=4&s=4000)][linuxserverurl]
## Contact information:-
| Type | Address/Details |
| :---: | --- |
| Discord | [Discord](https://linuxserver.io/discord) |
| IRC | `#linuxserver.io` on irc.libera.chat |
| Forum | [Discourse](https://discourse.linuxserver.io/) |
| Discord | [Discord](https://discord.gg/YWrKVTn) |
| IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl]
| Forum | [LinuxServer.io forum][forumurl] |
A custom base image built with [Arch Linux](https://archlinux.org) and [s6-overlay](https://github.com/just-containers/s6-overlay).
&nbsp;
&nbsp;
- Support for using our base images in your own projects is provided on a Reasonable Endeavours basis, please see our [Support Policy](https://www.linuxserver.io/supportpolicy) for details.
- There is no `latest` tag for any of our base images, by design. We often make breaking changes between versions, and we don't publish release notes like we do for the downstream images.
- If you're intending to distribute an image using one of our bases, please read our [docs on container branding](https://docs.linuxserver.io/general/container-branding/) first.
[![](https://images.microbadger.com/badges/image/lsiobase/arch.svg)](https://microbadger.com/images/lsiobase/arch "Get your own image badge on microbadger.com")
[![](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/Dockerfile-Link-green.png)](https://github.com/linuxserver/docker-baseimage-arch/blob/master/Dockerfile)
A custom base image built with [Alpine linux][appurl] and [S6 overlay](https://github.com/just-containers/s6-overlay)..
The following line is only in this repo for loop testing:

124
root/docker-mods Executable file
View File

@ -0,0 +1,124 @@
#!/usr/bin/with-contenv bash
# Exit if mods is not set
if [ -z ${DOCKER_MODS+x} ]; then
exit 0
fi
# Check for curl
if [ ! -f /usr/bin/curl ] || [ ! -f /usr/bin/jq ]; then
echo "[mod-init] Curl/JQ was not found on this system for Docker mods installing"
if [ -f /usr/bin/apt ]; then
## Ubuntu
apt-get update
apt-get install --no-install-recommends -y \
curl \
jq
elif [ -f /sbin/apk ]; then
# Alpine
apk add --no-cache \
curl \
jq
elif [ -f /usr/sbin/pacman ]; then
# Arch
pacman -Sy --noconfirm \
curl \
jq
fi
fi
## Functions
# Use different filtering depending on URL
get_blob_sha () {
if [[ $1 == "ghcr" ]]; then
curl \
--silent \
--location \
--request GET \
--header "Authorization: Bearer $2" \
$3 | jq -r '.layers[0].digest'
else
curl \
--silent \
--location \
--request GET \
--header "Authorization: Bearer $2" \
$3 | jq -r '.fsLayers[0].blobSum'
fi
}
# Main run logic
echo "[mod-init] Attempting to run Docker Modification Logic"
IFS='|'
DOCKER_MODS=(${DOCKER_MODS})
for DOCKER_MOD in "${DOCKER_MODS[@]}"; do
# Support alternative endpoints
if [[ ${DOCKER_MOD} == ghcr.io/* ]] || [[ ${DOCKER_MOD} == linuxserver/* ]]; then
DOCKER_MOD="${DOCKER_MOD#ghcr.io/*}"
ENDPOINT="${DOCKER_MOD%%:*}"
USERNAME="${DOCKER_MOD%%/*}"
REPO="${ENDPOINT#*/}"
TAG="${DOCKER_MOD#*:}"
if [[ ${TAG} == "${DOCKER_MOD}" ]]; then
TAG="latest"
fi
FILENAME="${USERNAME}.${REPO}.${TAG}"
AUTH_URL="https://ghcr.io/token?scope=repository%3A${USERNAME}%2F${REPO}%3Apull"
MANIFEST_URL="https://ghcr.io/v2/${ENDPOINT}/manifests/${TAG}"
BLOB_URL="https://ghcr.io/v2/${ENDPOINT}/blobs/"
MODE="ghcr"
else
ENDPOINT="${DOCKER_MOD%%:*}"
USERNAME="${DOCKER_MOD%%/*}"
REPO="${ENDPOINT#*/}"
TAG="${DOCKER_MOD#*:}"
if [[ ${TAG} == "${DOCKER_MOD}" ]]; then
TAG="latest"
fi
FILENAME="${USERNAME}.${REPO}.${TAG}"
AUTH_URL="https://auth.docker.io/token?service=registry.docker.io&scope=repository:${ENDPOINT}:pull"
MANIFEST_URL="https://registry-1.docker.io/v2/${ENDPOINT}/manifests/${TAG}"
BLOB_URL="https://registry-1.docker.io/v2/${ENDPOINT}/blobs/"
MODE="dockerhub"
fi
# Kill off modification logic if any of the usernames are banned
BLACKLIST=$(curl -s https://raw.githubusercontent.com/linuxserver/docker-mods/master/blacklist.txt)
IFS=$'\n'
BLACKLIST=(${BLACKLIST})
for BANNED in "${BLACKLIST[@]}"; do
if [ "${BANNED}" == "${USERNAME,,}" ]; then
if [ -z ${RUN_BANNED_MODS+x} ]; then
echo "[mod-init] ${DOCKER_MOD} is banned from use due to reported abuse aborting mod logic"
exit 0
else
echo "[mod-init] You have chosen to run banned mods ${DOCKER_MOD} will be applied"
fi
fi
done
echo "[mod-init] Applying ${DOCKER_MOD} files to container"
# Get Dockerhub token for api operations
TOKEN=\
"$(curl \
--silent \
--header 'GET' \
"${AUTH_URL}" \
| jq -r '.token' \
)"
# Determine first and only layer of image
SHALAYER=$(get_blob_sha "${MODE}" "${TOKEN}" "${MANIFEST_URL}")
# Check if we have allready applied this layer
if [ -f "/${FILENAME}" ] && [ "${SHALAYER}" == "$(cat /${FILENAME})" ]; then
echo "[mod-init] ${DOCKER_MOD} at ${SHALAYER} has been previously applied skipping"
else
# Download and extract layer to /
curl \
--silent \
--location \
--request GET \
--header "Authorization: Bearer ${TOKEN}" \
"${BLOB_URL}${SHALAYER}" \
| tar xz -C /
echo ${SHALAYER} > "/${FILENAME}"
fi
done

View File

@ -0,0 +1,16 @@
#! /bin/bash
if [[ "$(ls /var/run/s6/container_environment/ | xargs)" == *"FILE__"* ]]; then
for FILENAME in /var/run/s6/container_environment/*; do
if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
SECRETFILE=$(cat ${FILENAME})
if [[ -f ${SECRETFILE} ]]; then
FILESTRIP=${FILENAME//FILE__/}
cat ${SECRETFILE} > ${FILESTRIP}
echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
else
echo "[env-init] cannot find secret in ${FILENAME##*/}"
fi
fi
done
fi

View File

@ -0,0 +1,55 @@
#!/usr/bin/with-contenv bash
PUID=${PUID:-911}
PGID=${PGID:-911}
groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc
echo '
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------'
if [[ -f /donate.txt ]]; then
echo '
To support the app dev(s) visit:'
cat /donate.txt
fi
echo '
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------'
echo "
User uid: $(id -u abc)
User gid: $(id -g abc)
-------------------------------------
"
time32="$(date +%Y)"
if [[ "${time32}" == "1970" || "${time32}" == "1969" ]] && [ "$(uname -m)" == "armv7l" ]; then
echo '
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Your DockerHost is most likely running an outdated version of libseccomp
To fix this, please visit https://docs.linuxserver.io/faq#libseccomp
Some apps might not behave correctly without this
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'
fi
chown abc:abc /app
chown abc:abc /config
chown abc:abc /defaults

View File

@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
# create custom folders and secure permissions
mkdir -p /config/{custom-cont-init.d,custom-services.d}
chown -R 0:0 /config/{custom-cont-init.d,custom-services.d}

View File

@ -0,0 +1,49 @@
#!/usr/bin/with-contenv bash
# Directories
SCRIPTS_DIR="/config/custom-cont-init.d"
SERVICES_DIR="/config/custom-services.d"
# Remove all existing custom services before continuing to ensure
# we aren't running anything the user may have removed
if [ -n "$(/bin/ls -A /etc/services.d/custom-service-* 2>/dev/null)" ]; then
echo "[custom-init] removing existing custom services..."
rm -rf /etc/services.d/custom-service-*
fi
# Make sure custom init directory exists and has files in it
if ([ -e "${SCRIPTS_DIR}" ] && \
[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]) || \
([ -e "${SERVICES_DIR}" ] && \
[ -n "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]); then
if [ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]; then
echo "[custom-init] files found in ${SCRIPTS_DIR} executing"
for SCRIPT in ${SCRIPTS_DIR}/*; do
NAME="$(basename "${SCRIPT}")"
if [ -f "${SCRIPT}" ]; then
echo "[custom-init] ${NAME}: executing..."
/bin/bash ${SCRIPT}
echo "[custom-init] ${NAME}: exited $?"
elif [ ! -f "${SCRIPT}" ]; then
echo "[custom-init] ${NAME}: is not a file"
fi
done
fi
if [ -n "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]; then
echo "[custom-init] service files found in ${SERVICES_DIR}"
for SERVICE in ${SERVICES_DIR}/*; do
NAME="$(basename "${SERVICE}")"
if [ -f "${SERVICE}" ]; then
echo "[custom-init] ${NAME}: service detected, copying..."
mkdir -p /etc/services.d/custom-service-${NAME}/
cp ${SERVICE} /etc/services.d/custom-service-${NAME}/run
chmod +x /etc/services.d/custom-service-${NAME}/run
echo "[custom-init] ${NAME}: copied"
elif [ ! -f "${SERVICE}" ]; then
echo "[custom-init] ${NAME}: is not a file"
fi
done
fi
else
echo "[custom-init] no custom files found exiting..."
fi

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
echo "[ls.io-init] done."

View File

@ -1,12 +0,0 @@
───────────────────────────────────────
_____ __ __ _____ _____ _____ _____
| | | | __|_ _| | |
| --| | |__ | | | | | | | | |
|_____|_____|_____| |_| |_____|_|_|_|
_____ __ __ _ __ ____
| __ | | | | | | \
| __ -| | | | |__| | |
|_____|_____|_|_____|____/
Based on images from linuxserver.io
───────────────────────────────────────

View File

@ -1,44 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
PUID=${PUID:-911}
PGID=${PGID:-911}
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
USERHOME=$(grep abc /etc/passwd | cut -d ":" -f6)
usermod -d "/root" abc
groupmod -o -g "${PGID}" abc
usermod -o -u "${PUID}" abc
usermod -d "${USERHOME}" abc
fi
cat /etc/s6-overlay/s6-rc.d/init-adduser/branding
if [[ -f /donate.txt ]]; then
echo '
To support the app dev(s) visit:'
cat /donate.txt
fi
echo '
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────'
echo "
User UID: $(id -u abc)
User GID: $(id -g abc)
───────────────────────────────────────"
if [[ -f /build_version ]]; then
cat /build_version
echo '
───────────────────────────────────────
'
fi
lsiown abc:abc /app
lsiown abc:abc /config
lsiown abc:abc /defaults

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-adduser/run

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it's just the end of the downstream image init process

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it's just the start of the downstream image init process

View File

@ -1,31 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
for cron_user in abc root; do
if [[ -f "/etc/crontabs/${cron_user}" ]]; then
lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}"
crontab -u "${cron_user}" "/etc/crontabs/${cron_user}"
fi
if [[ -f "/defaults/crontabs/${cron_user}" ]]; then
# make folders
mkdir -p \
/config/crontabs
# if crontabs do not exist in config
if [[ ! -f "/config/crontabs/${cron_user}" ]]; then
# copy crontab from system
if crontab -l -u "${cron_user}" >/dev/null 2>&1; then
crontab -l -u "${cron_user}" >"/config/crontabs/${cron_user}"
fi
# if crontabs still do not exist in config (were not copied from system)
# copy crontab from image defaults (using -n, do not overwrite an existing file)
cp -n "/defaults/crontabs/${cron_user}" /config/crontabs/
fi
# set permissions and import user crontabs
lsiown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}"
crontab -u "${cron_user}" "/config/crontabs/${cron_user}"
fi
done

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-crontab-config/run

View File

@ -1,22 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# Directories
SCRIPTS_DIR="/custom-cont-init.d"
# Make sure custom init directory exists and has files in it
if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then
echo "[custom-init] Files found, executing"
for SCRIPT in "${SCRIPTS_DIR}"/*; do
NAME="$(basename "${SCRIPT}")"
if [[ -x "${SCRIPT}" ]]; then
echo "[custom-init] ${NAME}: executing..."
/bin/bash "${SCRIPT}"
echo "[custom-init] ${NAME}: exited $?"
elif [[ ! -x "${SCRIPT}" ]]; then
echo "[custom-init] ${NAME}: is not an executable file"
fi
done
else
echo "[custom-init] No custom files found, skipping..."
fi

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-custom-files/run

View File

@ -1,37 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [[ -z ${LSIO_NON_ROOT_USER} ]] && [[ -n ${ATTACHED_DEVICES_PERMS} ]]; then
FILES=$(find ${ATTACHED_DEVICES_PERMS} -print 2>/dev/null)
for i in ${FILES}; do
FILE_GID=$(stat -c '%g' "${i}")
FILE_UID=$(stat -c '%u' "${i}")
# check if user matches device
if id -u abc | grep -qw "${FILE_UID}"; then
echo "**** permissions for ${i} are good ****"
else
# check if group matches and that device has group rw
if id -G abc | grep -qw "${FILE_GID}" && [[ $(stat -c '%A' "${i}" | cut -b 5,6) == "rw" ]]; then
echo "**** permissions for ${i} are good ****"
# check if device needs to be added to group
elif ! id -G abc | grep -qw "${FILE_GID}"; then
# check if group needs to be created
GROUP_NAME=$(getent group "${FILE_GID}" | awk -F: '{print $1}')
if [[ -z "${GROUP_NAME}" ]]; then
GROUP_NAME="group$(head /dev/urandom | tr -dc 'a-z0-9' | head -c4)"
groupadd "${GROUP_NAME}"
groupmod -g "${FILE_GID}" "${GROUP_NAME}"
echo "**** creating group ${GROUP_NAME} with id ${FILE_GID} ****"
fi
echo "**** adding ${i} to group ${GROUP_NAME} with id ${FILE_GID} ****"
usermod -a -G "${GROUP_NAME}" abc
fi
# check if device has group rw
if [[ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]]; then
echo -e "**** The device ${i} does not have group read/write permissions, attempting to fix inside the container. ****"
chmod g+rw "${i}"
fi
fi
done
fi

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-device-perms/run

View File

@ -1,19 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then
for FILENAME in /run/s6/container_environment/FILE__*; do
SECRETFILE=$(cat "${FILENAME}")
if [[ -f ${SECRETFILE} ]]; then
FILESTRIP=${FILENAME//FILE__/}
if [[ $(tail -n1 "${SECRETFILE}" | wc -l) != 0 ]]; then
echo "[env-init] Your secret: ${FILENAME##*/}"
echo " contains a trailing newline and may not work as expected"
fi
cat "${SECRETFILE}" >"${FILESTRIP}"
echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
else
echo "[env-init] cannot find secret in ${FILENAME##*/}"
fi
done
fi

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-envfile/run

View File

@ -1,34 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
MIGRATIONS_DIR="/migrations"
MIGRATIONS_HISTORY="/config/.migrations"
echo "[migrations] started"
if [[ ! -d ${MIGRATIONS_DIR} ]]; then
echo "[migrations] no migrations found"
exit
fi
for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do
NAME="$(basename "${MIGRATION}")"
if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then
echo "[migrations] ${NAME}: skipped"
continue
fi
echo "[migrations] ${NAME}: executing..."
chmod +x "${MIGRATION}"
EXIT_CODE=$(
/bin/bash "${MIGRATION}"
echo $?
)
if [[ ${EXIT_CODE} -ne 0 ]]; then
echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support"
exit "${EXIT_CODE}"
fi
echo "${NAME}" >>${MIGRATIONS_HISTORY}
echo "[migrations] ${NAME}: succeeded"
done
echo "[migrations] done"

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-migrations/run

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it's just the end of the mod init process

View File

@ -1 +0,0 @@
/etc/s6-overlay/s6-rc.d/init-mods-package-install/run

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it's just the start of the mod init process

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it's just the end of the mod init process

View File

@ -1 +0,0 @@
oneshot

View File

@ -1 +0,0 @@
# This file doesn't do anything, it just signals that services can start

View File

@ -1,15 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc 2>/dev/null || true)" || -n "$(crontab -l -u root 2>/dev/null || true)" ]]; then
if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox || true) =~ [[:space:]](crond)([,]|$) ]]; then
exec busybox crond -f -S -l 5
elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then
exec /usr/sbin/cron -f -L 5
else
echo "**** cron not found ****"
sleep infinity
fi
else
sleep infinity
fi

View File

@ -1 +0,0 @@
longrun

7
root/usr/bin/with-contenv Executable file
View File

@ -0,0 +1,7 @@
#! /bin/bash
if [[ -f /var/run/s6/container_environment/UMASK ]] && [[ "$(pwdx $$)" =~ "/run/s6/services/" ]]; then
umask $(cat /var/run/s6/container_environment/UMASK)
exec /usr/bin/with-contenvb "$@"
else
exec /usr/bin/with-contenvb "$@"
fi