mirror of
https://github.com/linuxserver/docker-baseimage-arch.git
synced 2026-03-16 00:01:42 +08:00
Compare commits
No commits in common. "master" and "e8a2012f-ls3" have entirely different histories.
master
...
e8a2012f-l
@ -15,6 +15,6 @@ trim_trailing_whitespace = false
|
|||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
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_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|||||||
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@ -6,7 +6,7 @@
|
|||||||
* Read, and fill the Pull Request template
|
* 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 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 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
|
## Common files
|
||||||
|
|
||||||
@ -105,10 +105,10 @@ docker build \
|
|||||||
-t linuxserver/baseimage-arch:latest .
|
-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
|
```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`.
|
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Discord chat support
|
- name: Discord chat support
|
||||||
url: https://linuxserver.io/discord
|
url: https://discord.gg/YWrKVTn
|
||||||
about: Realtime support / chat with the community and the team.
|
about: Realtime support / chat with the community and the team.
|
||||||
|
|
||||||
- name: Discourse discussion forum
|
- name: Discourse discussion forum
|
||||||
|
|||||||
40
.github/ISSUE_TEMPLATE/issue.bug.md
vendored
Normal file
40
.github/ISSUE_TEMPLATE/issue.bug.md
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
|
||||||
|
---
|
||||||
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[][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" -->
|
||||||
68
.github/ISSUE_TEMPLATE/issue.bug.yml
vendored
68
.github/ISSUE_TEMPLATE/issue.bug.yml
vendored
@ -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
25
.github/ISSUE_TEMPLATE/issue.feature.md
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
|
||||||
|
---
|
||||||
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[][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 -->
|
||||||
31
.github/ISSUE_TEMPLATE/issue.feature.yml
vendored
31
.github/ISSUE_TEMPLATE/issue.feature.yml
vendored
@ -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
|
|
||||||
19
.github/workflows/call_issue_pr_tracker.yml
vendored
19
.github/workflows/call_issue_pr_tracker.yml
vendored
@ -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
|
|
||||||
16
.github/workflows/call_issues_cron.yml
vendored
16
.github/workflows/call_issues_cron.yml
vendored
@ -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
|
|
||||||
135
.github/workflows/external_trigger.yml
vendored
135
.github/workflows/external_trigger.yml
vendored
@ -3,145 +3,14 @@ name: External Trigger Main
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
external-trigger-master:
|
external-trigger-master:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v2.3.3
|
||||||
|
|
||||||
- name: External Trigger
|
- name: External Trigger
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
env:
|
|
||||||
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
|
|
||||||
run: |
|
run: |
|
||||||
printf "# External trigger for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
|
echo "**** No external release, exiting ****"
|
||||||
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
|
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
|
|
||||||
|
|||||||
37
.github/workflows/external_trigger_scheduler.yml
vendored
37
.github/workflows/external_trigger_scheduler.yml
vendored
@ -2,47 +2,42 @@ name: External Trigger Scheduler
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '39 * * * *'
|
- cron: '33 * * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
external-trigger-scheduler:
|
external-trigger-scheduler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v2.3.3
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: External Trigger Scheduler
|
- name: External Trigger Scheduler
|
||||||
run: |
|
run: |
|
||||||
printf "# External trigger scheduler for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
|
echo "**** Branches found: ****"
|
||||||
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
|
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||||
for br in $(git for-each-ref --format='%(refname:lstrip=3)' 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
|
do
|
||||||
if [[ "${br}" == "HEAD" ]]; then
|
br=$(echo "$br" | sed 's|origin/||g')
|
||||||
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
|
echo "**** Evaluating branch ${br} ****"
|
||||||
continue
|
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml \
|
||||||
fi
|
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||||
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
|
if [ "$br" == "$ls_branch" ]; then
|
||||||
ls_jenkins_vars=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml)
|
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||||
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
|
|
||||||
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
|
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 \
|
curl -iX POST \
|
||||||
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||||
https://api.github.com/repos/linuxserver/docker-baseimage-arch/actions/workflows/external_trigger.yml/dispatches
|
https://api.github.com/repos/linuxserver/docker-baseimage-arch/actions/workflows/external_trigger.yml/dispatches
|
||||||
else
|
else
|
||||||
echo "Skipping branch due to no external trigger workflow present." >> $GITHUB_STEP_SUMMARY
|
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||||
fi
|
fi
|
||||||
else
|
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
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
8
.github/workflows/greetings.yml
vendored
8
.github/workflows/greetings.yml
vendored
@ -2,18 +2,12 @@ name: Greetings
|
|||||||
|
|
||||||
on: [pull_request_target, issues]
|
on: [pull_request_target, issues]
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
greeting:
|
greeting:
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
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)!'
|
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 }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
38
.github/workflows/package_trigger.yml
vendored
Normal file
38
.github/workflows/package_trigger.yml
vendored
Normal 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"
|
||||||
103
.github/workflows/package_trigger_scheduler.yml
vendored
103
.github/workflows/package_trigger_scheduler.yml
vendored
@ -2,102 +2,49 @@ name: Package Trigger Scheduler
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '24 21 * * 6'
|
- cron: '55 13 * * 2'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package-trigger-scheduler:
|
package-trigger-scheduler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- uses: actions/checkout@v2.3.3
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Package Trigger Scheduler
|
- name: Package Trigger Scheduler
|
||||||
env:
|
|
||||||
SKIP_PACKAGE_TRIGGER: ${{ vars.SKIP_PACKAGE_TRIGGER }}
|
|
||||||
run: |
|
run: |
|
||||||
printf "# Package trigger scheduler for docker-baseimage-arch\n\n" >> $GITHUB_STEP_SUMMARY
|
echo "**** Branches found: ****"
|
||||||
printf "Found the branches:\n\n%s\n" "$(git for-each-ref --format='- %(refname:lstrip=3)' refs/remotes)" >> $GITHUB_STEP_SUMMARY
|
git for-each-ref --format='%(refname:short)' refs/remotes
|
||||||
for br in $(git for-each-ref --format='%(refname:lstrip=3)' 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
|
do
|
||||||
if [[ "${br}" == "HEAD" ]]; then
|
br=$(echo "$br" | sed 's|origin/||g')
|
||||||
printf "\nSkipping %s.\n" ${br} >> $GITHUB_STEP_SUMMARY
|
echo "**** Evaluating branch ${br} ****"
|
||||||
continue
|
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml \
|
||||||
fi
|
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
|
||||||
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
|
if [ "${br}" == "${ls_branch}" ]; then
|
||||||
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/jenkins-vars.yml)
|
echo "**** Branch ${br} appears to be live; checking workflow. ****"
|
||||||
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/Jenkinsfile >/dev/null 2>&1; then
|
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-baseimage-arch/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
|
||||||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
|
||||||
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
|
|
||||||
triggered_branches="${triggered_branches}${br} "
|
triggered_branches="${triggered_branches}${br} "
|
||||||
response=$(curl -iX POST \
|
curl -iX POST \
|
||||||
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-arch/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
|
-H "Authorization: token ${{ secrets.CR_PAT }}" \
|
||||||
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
if [[ -z "${response}" ]]; then
|
-d "{\"ref\":\"refs/heads/${br}\"}" \
|
||||||
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
|
https://api.github.com/repos/linuxserver/docker-baseimage-arch/actions/workflows/package_trigger.yml/dispatches
|
||||||
echo "> Jenkins build could not be triggered. Skipping branch."
|
sleep 30
|
||||||
continue
|
else
|
||||||
fi
|
echo "**** Workflow doesn't exist; skipping trigger. ****"
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
else
|
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
|
fi
|
||||||
done
|
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} ****"
|
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 ****"
|
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,
|
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}"'"}],
|
"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 }}
|
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
fi
|
|
||||||
|
|||||||
12
.github/workflows/permissions.yml
vendored
12
.github/workflows/permissions.yml
vendored
@ -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
23
.github/workflows/stale.yml
vendored
Normal 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 }}
|
||||||
100
Dockerfile
100
Dockerfile
@ -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
|
# pacstrap stage
|
||||||
FROM archlinux:base AS pacstrap-stage
|
FROM scratch as pacstrap-stage
|
||||||
|
COPY --from=rootfs-stage /root-out/ /
|
||||||
|
COPY patch/ /tmp/patch
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
mkdir -m 0755 -p \
|
mkdir -m 0755 -p \
|
||||||
@ -12,19 +43,13 @@ RUN \
|
|||||||
mkdir -m 0555 -p \
|
mkdir -m 0555 -p \
|
||||||
/root-out/{sys,proc} && \
|
/root-out/{sys,proc} && \
|
||||||
pacman -r /root-out -Sy --noconfirm \
|
pacman -r /root-out -Sy --noconfirm \
|
||||||
archlinux-keyring \
|
|
||||||
bash \
|
bash \
|
||||||
busybox \
|
|
||||||
catatonit \
|
|
||||||
coreutils \
|
coreutils \
|
||||||
curl \
|
|
||||||
findutils \
|
findutils \
|
||||||
gawk \
|
gawk \
|
||||||
grep \
|
grep \
|
||||||
gzip \
|
gzip \
|
||||||
jq \
|
|
||||||
less \
|
less \
|
||||||
netcat \
|
|
||||||
pacman \
|
pacman \
|
||||||
procps-ng \
|
procps-ng \
|
||||||
sed \
|
sed \
|
||||||
@ -35,71 +60,56 @@ RUN \
|
|||||||
which && \
|
which && \
|
||||||
cp -a /etc/pacman.conf /root-out/etc/pacman.conf && \
|
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/mirrorlist /root-out/etc/pacman.d/mirrorlist && \
|
||||||
|
cp -a /tmp/patch/init-stage2.patch /root-out/ && \
|
||||||
rm /root-out/var/lib/pacman/sync/*
|
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
|
# runtime stage
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=pacstrap-stage /root-out/ /
|
COPY --from=pacstrap-stage /root-out/ /
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VERSION
|
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 build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
LABEL maintainer="TheLamer"
|
LABEL maintainer="TheLamer"
|
||||||
|
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
# set version for s6 overlay
|
||||||
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"
|
ARG OVERLAY_VERSION="v2.2.0.3"
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
|
ARG OVERLAY_ARCH="amd64"
|
||||||
ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/with-contenv.${WITHCONTENV_VERSION}" "/usr/bin/with-contenv"
|
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
||||||
HOME="/root" \
|
HOME="/root" \
|
||||||
TERM="xterm" \
|
TERM="xterm"
|
||||||
S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \
|
|
||||||
S6_VERBOSITY=1 \
|
|
||||||
S6_STAGE2_HOOK=/docker-mods \
|
|
||||||
VIRTUAL_ENV=/lsiopy \
|
|
||||||
PATH="/lsiopy/bin:$PATH"
|
|
||||||
|
|
||||||
|
# add s6 overlay
|
||||||
|
ADD https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer /tmp/
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** create abc user and make our folders ****" && \
|
echo "**** create abc user and make our folders ****" && \
|
||||||
|
groupadd -g 1000 users && \
|
||||||
useradd -u 911 -U -d /config -s /bin/false abc && \
|
useradd -u 911 -U -d /config -s /bin/false abc && \
|
||||||
usermod -G users abc && \
|
usermod -G users abc && \
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
/app \
|
/app \
|
||||||
/config \
|
/config \
|
||||||
/defaults \
|
/defaults && \
|
||||||
/lsiopy && \
|
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 ****" && \
|
echo "**** configure pacman ****" && \
|
||||||
locale-gen && \
|
locale-gen && \
|
||||||
pacman-key --init && \
|
pacman-key --init && \
|
||||||
pacman-key --populate archlinux && \
|
pacman-key --populate archlinux && \
|
||||||
echo "**** configure locale ****" && \
|
echo "**** patch files ****" && \
|
||||||
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
pacman -Sy --noconfirm \
|
||||||
locale-gen && \
|
patch && \
|
||||||
|
patch -u /etc/s6/init/init-stage2 -i /init-stage2.patch && \
|
||||||
echo "**** cleanup ****" && \
|
echo "**** cleanup ****" && \
|
||||||
|
pacman -Rsn --noconfirm \
|
||||||
|
patch && \
|
||||||
rm -rf \
|
rm -rf \
|
||||||
|
/init-stage2.patch \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/cache/pacman/pkg/* \
|
|
||||||
/var/lib/pacman/sync/*
|
/var/lib/pacman/sync/*
|
||||||
|
|
||||||
# add local files
|
# add local files
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
# syntax=docker/dockerfile:1
|
FROM alpine:3.14 as rootfs-stage
|
||||||
|
|
||||||
FROM alpine:3 AS rootfs-stage
|
|
||||||
|
|
||||||
# install packages
|
# install packages
|
||||||
RUN \
|
RUN \
|
||||||
@ -23,8 +21,9 @@ RUN \
|
|||||||
/root-out
|
/root-out
|
||||||
|
|
||||||
# pacstrap stage
|
# pacstrap stage
|
||||||
FROM scratch AS pacstrap-stage
|
FROM scratch as pacstrap-stage
|
||||||
COPY --from=rootfs-stage /root-out/ /
|
COPY --from=rootfs-stage /root-out/ /
|
||||||
|
COPY patch/ /tmp/patch
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
mkdir -m 0755 -p \
|
mkdir -m 0755 -p \
|
||||||
@ -34,23 +33,16 @@ RUN \
|
|||||||
/root-out/tmp && \
|
/root-out/tmp && \
|
||||||
mkdir -m 0555 -p \
|
mkdir -m 0555 -p \
|
||||||
/root-out/{sys,proc} && \
|
/root-out/{sys,proc} && \
|
||||||
sed -i 's/DownloadUser = alpm//g' /etc/pacman.conf && \
|
|
||||||
pacman-key --init && \
|
pacman-key --init && \
|
||||||
pacman-key --populate archlinuxarm && \
|
pacman-key --populate archlinuxarm && \
|
||||||
pacman -r /root-out -Sy --noconfirm \
|
pacman -r /root-out -Sy --noconfirm \
|
||||||
archlinuxarm-keyring \
|
|
||||||
bash \
|
bash \
|
||||||
busybox \
|
|
||||||
catatonit \
|
|
||||||
coreutils \
|
coreutils \
|
||||||
curl \
|
|
||||||
findutils \
|
findutils \
|
||||||
gawk \
|
gawk \
|
||||||
grep \
|
grep \
|
||||||
gzip \
|
gzip \
|
||||||
jq \
|
|
||||||
less \
|
less \
|
||||||
netcat \
|
|
||||||
pacman \
|
pacman \
|
||||||
procps-ng \
|
procps-ng \
|
||||||
sed \
|
sed \
|
||||||
@ -61,74 +53,56 @@ RUN \
|
|||||||
which && \
|
which && \
|
||||||
cp -a /etc/pacman.conf /root-out/etc/pacman.conf && \
|
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/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/*
|
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
|
# runtime stage
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=pacstrap-stage /root-out/ /
|
COPY --from=pacstrap-stage /root-out/ /
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VERSION
|
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 build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||||
LABEL maintainer="TheLamer"
|
LABEL maintainer="TheLamer"
|
||||||
|
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/docker-mods.${MODS_VERSION}" "/docker-mods"
|
# set version for s6 overlay
|
||||||
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"
|
ARG OVERLAY_VERSION="v2.2.0.3"
|
||||||
ADD --chmod=744 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/lsiown.${LSIOWN_VERSION}" "/usr/bin/lsiown"
|
ARG OVERLAY_ARCH="aarch64"
|
||||||
ADD --chmod=755 "https://raw.githubusercontent.com/linuxserver/docker-mods/mod-scripts/with-contenv.${WITHCONTENV_VERSION}" "/usr/bin/with-contenv"
|
|
||||||
|
|
||||||
# environment variables
|
# environment variables
|
||||||
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \
|
||||||
HOME="/root" \
|
HOME="/root" \
|
||||||
TERM="xterm" \
|
TERM="xterm"
|
||||||
S6_CMD_WAIT_FOR_SERVICES_MAXTIME="0" \
|
|
||||||
S6_VERBOSITY=1 \
|
|
||||||
S6_STAGE2_HOOK=/docker-mods \
|
|
||||||
VIRTUAL_ENV=/lsiopy \
|
|
||||||
PATH="/lsiopy/bin:$PATH"
|
|
||||||
|
|
||||||
|
# add s6 overlay
|
||||||
|
ADD https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer /tmp/
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** create abc user and make our folders ****" && \
|
echo "**** create abc user and make our folders ****" && \
|
||||||
|
groupadd -g 1000 users && \
|
||||||
useradd -u 911 -U -d /config -s /bin/false abc && \
|
useradd -u 911 -U -d /config -s /bin/false abc && \
|
||||||
usermod -G users abc && \
|
usermod -G users abc && \
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
/app \
|
/app \
|
||||||
/config \
|
/config \
|
||||||
/defaults \
|
/defaults && \
|
||||||
/lsiopy && \
|
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 ****" && \
|
echo "**** configure pacman ****" && \
|
||||||
locale-gen && \
|
locale-gen && \
|
||||||
echo "**** configure locale ****" && \
|
pacman-key --init && \
|
||||||
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
pacman-key --populate archlinuxarm && \
|
||||||
locale-gen && \
|
echo "**** patch files ****" && \
|
||||||
|
pacman -Sy --noconfirm \
|
||||||
|
patch && \
|
||||||
|
patch -u /etc/s6/init/init-stage2 -i /init-stage2.patch && \
|
||||||
echo "**** cleanup ****" && \
|
echo "**** cleanup ****" && \
|
||||||
chmod 755 \
|
pacman -Rsn --noconfirm \
|
||||||
/etc \
|
patch && \
|
||||||
/usr \
|
|
||||||
/usr/bin && \
|
|
||||||
rm -rf \
|
rm -rf \
|
||||||
|
/init-stage2.patch \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/cache/pacman/pkg/* \
|
|
||||||
/var/lib/pacman/sync/*
|
/var/lib/pacman/sync/*
|
||||||
|
|
||||||
# add local files
|
# add local files
|
||||||
|
|||||||
111
Dockerfile.armhf
Normal file
111
Dockerfile.armhf
Normal 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"]
|
||||||
862
Jenkinsfile
vendored
862
Jenkinsfile
vendored
File diff suppressed because it is too large
Load Diff
27
README.md
27
README.md
@ -1,20 +1,29 @@
|
|||||||
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
<!-- DO NOT EDIT THIS FILE MANUALLY -->
|
||||||
<!-- Please read https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/CONTRIBUTING.md -->
|
<!-- Please read the https://github.com/linuxserver/docker-baseimage-arch/blob/master/.github/CONTRIBUTING.md -->
|
||||||
[](https://linuxserver.io)
|
|
||||||
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[forumurl]: https://forum.linuxserver.io
|
||||||
|
[ircurl]: https://www.linuxserver.io/irc/
|
||||||
|
[appurl]: https://archlinux.org/
|
||||||
|
|
||||||
|
[][linuxserverurl]
|
||||||
|
|
||||||
## Contact information:-
|
## Contact information:-
|
||||||
|
|
||||||
| Type | Address/Details |
|
| Type | Address/Details |
|
||||||
| :---: | --- |
|
| :---: | --- |
|
||||||
| Discord | [Discord](https://linuxserver.io/discord) |
|
| Discord | [Discord](https://discord.gg/YWrKVTn) |
|
||||||
| IRC | `#linuxserver.io` on irc.libera.chat |
|
| IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl]
|
||||||
| Forum | [Discourse](https://discourse.linuxserver.io/) |
|
| 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).
|
|
||||||
|
|
||||||
|
|
||||||
- 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.
|
[](https://microbadger.com/images/lsiobase/arch "Get your own image badge on microbadger.com")
|
||||||
- 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://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:
|
The following line is only in this repo for loop testing:
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,10 @@
|
|||||||
|
|
||||||
# jenkins variables
|
# jenkins variables
|
||||||
project_name: docker-baseimage-arch
|
project_name: docker-baseimage-arch
|
||||||
external_type: na
|
external_type: os
|
||||||
custom_version_command: "echo $(date +%F)"
|
|
||||||
release_type: stable
|
release_type: stable
|
||||||
release_tag: latest
|
release_tag: latest
|
||||||
ls_branch: master
|
ls_branch: master
|
||||||
image_sbom: true
|
|
||||||
image_provenance: true
|
|
||||||
repo_vars:
|
repo_vars:
|
||||||
- BUILD_VERSION_ARG = 'OS'
|
- BUILD_VERSION_ARG = 'OS'
|
||||||
- LS_USER = 'linuxserver'
|
- LS_USER = 'linuxserver'
|
||||||
@ -24,6 +21,6 @@ repo_vars:
|
|||||||
- CI_PORT='80'
|
- CI_PORT='80'
|
||||||
- CI_SSL='true'
|
- CI_SSL='true'
|
||||||
- CI_DELAY='30'
|
- CI_DELAY='30'
|
||||||
- CI_DOCKERENV='LSIO_FIRST_PARTY=true'
|
- CI_DOCKERENV='TZ=US/Pacific'
|
||||||
- CI_AUTH=''
|
- CI_AUTH='user:password'
|
||||||
- CI_WEBPATH=''
|
- CI_WEBPATH=''
|
||||||
|
|||||||
@ -1,134 +1,80 @@
|
|||||||
NAME VERSION TYPE
|
acl 2.3.1-1
|
||||||
acl 2.3.2-1 alpm
|
archlinux-keyring 20210802-1
|
||||||
archlinux-keyring 20260301-1 alpm
|
attr 2.5.1-1
|
||||||
attr 2.5.2-1 alpm
|
audit 3.0.3-1
|
||||||
audit 4.1.3-1 alpm
|
bash 5.1.008-1
|
||||||
bash 5.3.9-1 alpm
|
bzip2 1.0.8-4
|
||||||
binutils 2.46-1 alpm
|
ca-certificates 20210603-1
|
||||||
brotli 1.2.0-1 alpm
|
ca-certificates-mozilla 3.68-1
|
||||||
busybox 1.36.1-2 alpm
|
ca-certificates-utils 20210603-1
|
||||||
bzip2 1.0.8-6 alpm
|
coreutils 8.32-1
|
||||||
ca-certificates 20240618-1 alpm
|
curl 7.78.0-1
|
||||||
ca-certificates-mozilla 3.121-1 alpm
|
e2fsprogs 1.46.3-1
|
||||||
ca-certificates-utils 20240618-1 alpm
|
expat 2.4.1-1
|
||||||
catatonit 0.2.1-2 alpm
|
file 5.40-5
|
||||||
command-line-arguments UNKNOWN go-module
|
filesystem 2021.05.31-1
|
||||||
coreutils 9.10-1 alpm
|
findutils 4.8.0-1
|
||||||
cryptsetup 2.8.4-1 alpm
|
gawk 5.1.0-1
|
||||||
curl 8.18.0-3 alpm
|
gcc-libs 11.1.0-1
|
||||||
dbus 1.16.2-1 alpm
|
glib2 2.68.3-1
|
||||||
dbus-broker 37-3 alpm
|
glibc 2.33-5
|
||||||
dbus-broker-units 37-3 alpm
|
gmp 6.2.1-1
|
||||||
dbus-units 37-3 alpm
|
gnupg 2.2.29-1
|
||||||
device-mapper 2.03.38-1 alpm
|
gnutls 3.7.2-2
|
||||||
e2fsprogs 1.47.3-2 alpm
|
gpgme 1.16.0-1
|
||||||
expat 2.7.4-1 alpm
|
grep 3.6-1
|
||||||
file 5.47-1 alpm
|
gzip 1.10-3
|
||||||
filesystem 2025.10.12-1 alpm
|
iana-etc 20210624-1
|
||||||
findutils 4.10.0-3 alpm
|
keyutils 1.6.3-1
|
||||||
gawk 5.4.0-1 alpm
|
krb5 1.19.1-1
|
||||||
gcc-libs 15.2.1+r604+g0b99615a8aef-1 alpm
|
less 1:590-1
|
||||||
gdbm 1.26-2 alpm
|
libarchive 3.5.1-1
|
||||||
gettext 1.0-2 alpm
|
libassuan 2.5.5-1
|
||||||
glib2 2.86.4-1 alpm
|
libcap 2.51-1
|
||||||
glibc 2.43+r5+g856c426a7534-1 alpm
|
libcap-ng 0.8.2-3
|
||||||
gmp 6.3.0-3 alpm
|
libffi 3.3-4
|
||||||
gnulib-l10n 20241231-1 alpm
|
libgcrypt 1.9.3-1
|
||||||
gnupg 2.4.9-1 alpm
|
libgpg-error 1.42-1
|
||||||
gnutls 3.8.12-2 alpm
|
libidn2 2.3.2-1
|
||||||
gpgme 2.0.1-3 alpm
|
libksba 1.6.0-1
|
||||||
grep 3.12-2 alpm
|
libldap 2.4.59-2
|
||||||
gzip 1.14-2 alpm
|
libnghttp2 1.44.0-1
|
||||||
hwdata 0.405-1 alpm
|
libp11-kit 0.24.0-1
|
||||||
iana-etc 20260225-2 alpm
|
libpsl 0.21.1-1
|
||||||
icu 78.2-2 alpm
|
libsasl 2.1.27-3
|
||||||
jansson 2.15.0-1 alpm
|
libseccomp 2.5.1-2
|
||||||
jq 1.8.1-1 alpm
|
libsecret 0.20.4-1
|
||||||
json-c 0.18-2 alpm
|
libssh2 1.9.0-3
|
||||||
kbd 2.9.0-1 alpm
|
libtasn1 4.17.0-1
|
||||||
kernel.org/pub/linux/libs/security/libcap/cap v1.2.77 go-module
|
libtirpc 1.3.2-1
|
||||||
kernel.org/pub/linux/libs/security/libcap/psx v1.2.77 go-module
|
libunistring 0.9.10-3
|
||||||
keyutils 1.6.3-3 alpm
|
libxcrypt 4.4.23-1
|
||||||
kmod 34.2-1 alpm
|
linux-api-headers 5.12.3-1
|
||||||
krb5 1.21.3-2 alpm
|
lz4 1:1.9.3-2
|
||||||
leancrypto 1.6.0-1 alpm
|
mpfr 4.1.0-2
|
||||||
less 1:692-1 alpm
|
ncurses 6.2-2
|
||||||
libarchive 3.8.5-1 alpm
|
nettle 3.7.3-1
|
||||||
libasan 15.2.1+r604+g0b99615a8aef-1 alpm
|
npth 1.6-3
|
||||||
libassuan 3.0.0-1 alpm
|
openssl 1.1.1.k-1
|
||||||
libatomic 15.2.1+r604+g0b99615a8aef-1 alpm
|
p11-kit 0.24.0-1
|
||||||
libbsd 0.12.2-2 alpm
|
pacman 6.0.0-5
|
||||||
libcap 2.77-1 alpm
|
pacman-mirrorlist 20210718-1
|
||||||
libcap-ng 0.9-1 alpm
|
pam 1.5.1-1
|
||||||
libelf 0.194-2 alpm
|
pambase 20210605-2
|
||||||
libevent 2.1.12-5 alpm
|
pcre 8.45-1
|
||||||
libffi 3.5.2-1 alpm
|
pcre2 10.37-1
|
||||||
libgcc 15.2.1+r604+g0b99615a8aef-1 alpm
|
pinentry 1.1.1-1
|
||||||
libgcrypt 1.12.1-1 alpm
|
procps-ng 3.3.17-1
|
||||||
libgfortran 15.2.1+r604+g0b99615a8aef-1 alpm
|
readline 8.1.001-1
|
||||||
libgomp 15.2.1+r604+g0b99615a8aef-1 alpm
|
sed 4.8-1
|
||||||
libgpg-error 1.59-1 alpm
|
shadow 4.8.1-4
|
||||||
libidn2 2.3.8-1 alpm
|
sqlite 3.36.0-1
|
||||||
libksba 1.6.8-1 alpm
|
systemd-libs 249.2-1
|
||||||
libldap 2.6.12-1 alpm
|
tar 1.34-1
|
||||||
liblsan 15.2.1+r604+g0b99615a8aef-1 alpm
|
tzdata 2021a-1
|
||||||
libmakepkg-dropins 20-1 alpm
|
util-linux 2.37.1-1
|
||||||
libmd 1.1.0-2 alpm
|
util-linux-libs 2.37.1-1
|
||||||
libnghttp2 1.68.0-1 alpm
|
which 2.21-5
|
||||||
libnghttp3 1.15.0-1 alpm
|
xz 5.2.5-1
|
||||||
libngtcp2 1.21.0-1 alpm
|
zlib 1:1.2.11-4
|
||||||
libnsl 2.0.1-1 alpm
|
zstd 1.5.0-1
|
||||||
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
|
|
||||||
|
|||||||
15
patch/init-stage2.patch
Normal file
15
patch/init-stage2.patch
Normal 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
|
||||||
@ -4,21 +4,29 @@
|
|||||||
project_name: baseimage-arch
|
project_name: baseimage-arch
|
||||||
full_custom_readme: |
|
full_custom_readme: |
|
||||||
{% raw -%}
|
{% raw -%}
|
||||||
[](https://linuxserver.io)
|
[linuxserverurl]: https://linuxserver.io
|
||||||
|
[forumurl]: https://forum.linuxserver.io
|
||||||
|
[ircurl]: https://www.linuxserver.io/irc/
|
||||||
|
[appurl]: https://archlinux.org/
|
||||||
|
|
||||||
|
[][linuxserverurl]
|
||||||
|
|
||||||
## Contact information:-
|
## Contact information:-
|
||||||
|
|
||||||
| Type | Address/Details |
|
| Type | Address/Details |
|
||||||
| :---: | --- |
|
| :---: | --- |
|
||||||
| Discord | [Discord](https://linuxserver.io/discord) |
|
| Discord | [Discord](https://discord.gg/YWrKVTn) |
|
||||||
| IRC | `#linuxserver.io` on irc.libera.chat |
|
| IRC | freenode at `#linuxserver.io` more information at:- [IRC][ircurl]
|
||||||
| Forum | [Discourse](https://discourse.linuxserver.io/) |
|
| 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).
|
|
||||||
|
|
||||||
|
|
||||||
- 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.
|
[](https://microbadger.com/images/lsiobase/arch "Get your own image badge on microbadger.com")
|
||||||
- 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://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:
|
The following line is only in this repo for loop testing:
|
||||||
|
|
||||||
|
|||||||
124
root/docker-mods
Executable file
124
root/docker-mods
Executable 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
|
||||||
16
root/etc/cont-init.d/01-envfile
Normal file
16
root/etc/cont-init.d/01-envfile
Normal 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
|
||||||
55
root/etc/cont-init.d/10-adduser
Normal file
55
root/etc/cont-init.d/10-adduser
Normal 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
|
||||||
5
root/etc/cont-init.d/90-custom-folders
Normal file
5
root/etc/cont-init.d/90-custom-folders
Normal 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}
|
||||||
49
root/etc/cont-init.d/99-custom-files
Normal file
49
root/etc/cont-init.d/99-custom-files
Normal 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
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
echo "[ls.io-init] done."
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
───────────────────────────────────────
|
|
||||||
_____ __ __ _____ _____ _____ _____
|
|
||||||
| | | | __|_ _| | |
|
|
||||||
| --| | |__ | | | | | | | | |
|
|
||||||
|_____|_____|_____| |_| |_____|_|_|_|
|
|
||||||
_____ __ __ _ __ ____
|
|
||||||
| __ | | | | | | \
|
|
||||||
| __ -| | | | |__| | |
|
|
||||||
|_____|_____|_|_____|____/
|
|
||||||
|
|
||||||
Based on images from linuxserver.io
|
|
||||||
───────────────────────────────────────
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-adduser/run
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it's just the end of the downstream image init process
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it's just the start of the downstream image init process
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-crontab-config/run
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-custom-files/run
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-device-perms/run
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-envfile/run
|
|
||||||
@ -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"
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-migrations/run
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it's just the end of the mod init process
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
/etc/s6-overlay/s6-rc.d/init-mods-package-install/run
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it's just the start of the mod init process
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it's just the end of the mod init process
|
|
||||||
@ -1 +0,0 @@
|
|||||||
oneshot
|
|
||||||
@ -1 +0,0 @@
|
|||||||
# This file doesn't do anything, it just signals that services can start
|
|
||||||
@ -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
|
|
||||||
@ -1 +0,0 @@
|
|||||||
longrun
|
|
||||||
7
root/usr/bin/with-contenv
Executable file
7
root/usr/bin/with-contenv
Executable 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
|
||||||
Loading…
x
Reference in New Issue
Block a user