Compare commits

..

No commits in common. "master" and "v3.6.2-ls54" have entirely different histories.

24 changed files with 484 additions and 1085 deletions

View File

@ -1,20 +0,0 @@
# This file is globally distributed to all container image projects from
# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
trim_trailing_whitespace = false
[{Dockerfile*,**.yml}]
indent_style = space
indent_size = 2
[{**.sh,root/etc/cont-init.d/**,root/etc/services.d/**}]
indent_style = space
indent_size = 4

View File

@ -4,7 +4,7 @@
* While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open. * While contributing make sure to make all your changes before creating a Pull Request, as our pipeline builds each commit after the PR is open.
* 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 or documentation in the README please file an issue
* 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://discord.gg/YWrKVTn) * 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)
@ -96,7 +96,7 @@ If you are proposing additional packages to be added, ensure that you added the
### Testing your changes ### Testing your changes
```bash ```
git clone https://github.com/linuxserver/docker-code-server.git git clone https://github.com/linuxserver/docker-code-server.git
cd docker-code-server cd docker-code-server
docker build \ docker build \
@ -106,14 +106,13 @@ docker build \
``` ```
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
```
```bash
docker run --rm --privileged multiarch/qemu-user-static:register --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`.
## Update the changelog ## Update the chagelog
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-code-server/tree/master/root), add an entry to the changelog If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-code-server/tree/master/root), add an entry to the changelog

10
.github/ISSUE_TEMPLATE/issue.bug.md → .github/ISSUE_TEMPLATE.md vendored Executable file → Normal file
View File

@ -1,14 +1,12 @@
---
name: Bug report
about: Create a report to help us improve
---
[linuxserverurl]: https://linuxserver.io [linuxserverurl]: https://linuxserver.io
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. ---> <!--- If 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 --> <!--- 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 issue in the Title above -->
------------------------------ ------------------------------

View File

@ -1,13 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Discord chat support
url: https://discord.gg/YWrKVTn
about: Realtime support / chat with the community and the team.
- name: Discourse discussion forum
url: https://discourse.linuxserver.io
about: Post on our community forum.
- name: Documentation
url: https://docs.linuxserver.io/images/docker-code-server
about: Documentation - information about all of our containers.

View File

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

View File

@ -6,7 +6,7 @@
<!--- Before submitting a pull request please check the following --> <!--- Before submitting a pull request please check the following -->
<!--- 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 or documentation in the README please file an issue and let us sort it out we do not need a PR -->
<!--- 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/ --> <!--- 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/ -->
<!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message --> <!--- That if the PR is addressing an existing issue include, closes #<issue number> , in the body of the PR commit message -->
<!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message --> <!--- You have included links to any files / patches etc your PR may be using in the body of the PR commit message -->

View File

@ -1,92 +0,0 @@
name: External Trigger Main
on:
workflow_dispatch:
jobs:
external-trigger-master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
- name: External Trigger
if: github.ref == 'refs/heads/master'
run: |
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER is set; skipping trigger. ****"
exit 0
fi
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_CODE_SERVER_MASTER\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||')
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for code-server branch master"
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-code-server/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=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g')
echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****"
image="linuxserver/code-server"
tag="latest"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fcode-server%3Apull" \
| jq -r '.token')
multidigest=$(curl -s \
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/manifests/${tag}" \
| jq -r 'first(.manifests[].digest)')
digest=$(curl -s \
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
| jq -r '.config.digest')
image_info=$(curl -sL \
--header "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/${image}/blobs/${digest}" \
| jq -r '.container_config')
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 "**** Can't retrieve last pushed version, exiting ****"
FAILURE_REASON="Can't retrieve last pushed version for code-server 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} ****"
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/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 ****"
exit 0
else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/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'} ****"
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 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 code-server tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
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

View File

@ -1,43 +0,0 @@
name: External Trigger Scheduler
on:
schedule:
- cron: '41 * * * *'
workflow_dispatch:
jobs:
external-trigger-scheduler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
with:
fetch-depth: '0'
- name: External Trigger Scheduler
run: |
echo "**** Branches found: ****"
git for-each-ref --format='%(refname:short)' refs/remotes
echo "**** Pulling the yq docker image ****"
docker pull ghcr.io/linuxserver/yq
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
do
br=$(echo "$br" | sed 's|origin/||g')
echo "**** Evaluating branch ${br} ****"
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/jenkins-vars.yml \
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
if [ "$br" == "$ls_branch" ]; then
echo "**** Branch ${br} appears to be live; checking workflow. ****"
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then
echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****."
curl -iX POST \
-H "Authorization: token ${{ secrets.CR_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"ref\":\"refs/heads/${br}\"}" \
https://api.github.com/repos/linuxserver/docker-code-server/actions/workflows/external_trigger.yml/dispatches
else
echo "**** Workflow doesn't exist; skipping trigger. ****"
fi
else
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
fi
done

View File

@ -8,6 +8,6 @@ jobs:
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 [bug](https://github.com/linuxserver/docker-code-server/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-code-server/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!' issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-code-server/blob/master/.github/ISSUE_TEMPLATE.md)!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-code-server/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-code-server/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,38 +0,0 @@
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_CODE_SERVER_MASTER }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_CODE_SERVER_MASTER is set; skipping trigger. ****"
exit 0
fi
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/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_CODE_SERVER_MASTER\". ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
sleep 10
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
buildurl="${buildurl%$'\r'}"
echo "**** Jenkins job build url: ${buildurl} ****"
echo "**** Attempting to change the Jenkins job description ****"
curl -iX POST \
"${buildurl}submitDescription" \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"

View File

@ -1,50 +0,0 @@
name: Package Trigger Scheduler
on:
schedule:
- cron: '00 12 * * 0'
workflow_dispatch:
jobs:
package-trigger-scheduler:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3
with:
fetch-depth: '0'
- name: Package Trigger Scheduler
run: |
echo "**** Branches found: ****"
git for-each-ref --format='%(refname:short)' refs/remotes
echo "**** Pulling the yq docker image ****"
docker pull ghcr.io/linuxserver/yq
for br in $(git for-each-ref --format='%(refname:short)' refs/remotes)
do
br=$(echo "$br" | sed 's|origin/||g')
echo "**** Evaluating branch ${br} ****"
ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/jenkins-vars.yml \
| docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch)
if [ "${br}" == "${ls_branch}" ]; then
echo "**** Branch ${br} appears to be live; checking workflow. ****"
if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-code-server/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then
echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****"
triggered_branches="${triggered_branches}${br} "
curl -iX POST \
-H "Authorization: token ${{ secrets.CR_PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"ref\":\"refs/heads/${br}\"}" \
https://api.github.com/repos/linuxserver/docker-code-server/actions/workflows/package_trigger.yml/dispatches
sleep 30
else
echo "**** Workflow doesn't exist; skipping trigger. ****"
fi
else
echo "**** ${br} appears to be a dev branch; skipping trigger. ****"
fi
done
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
echo "**** Notifying Discord ****"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Package Check Build(s) Triggered for code-server** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-code-server/activity/"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v1
with: 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-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-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."

1
.gitignore vendored
View File

@ -41,4 +41,3 @@ $RECYCLE.BIN/
Network Trash Folder Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
.jenkins-external

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -11,50 +11,53 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ RUN \
echo "**** install node repo ****" && \ echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ apt-get update && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \ apt-get install -y \
> /etc/apt/sources.list.d/nodesource.list && \ gnupg && \
echo "**** install build dependencies ****" && \ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-get update && \ echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
apt-get install -y \ > /etc/apt/sources.list.d/nodesource.list && \
build-essential \ curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
nodejs && \ echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
echo "**** install runtime dependencies ****" && \ > /etc/apt/sources.list.d/yarn.list && \
apt-get install -y \ echo "**** install build dependencies ****" && \
git \ apt-get update && \
jq \ apt-get install -y \
libatomic1 \ build-essential \
nano \ libx11-dev \
net-tools \ libxkbfile-dev \
sudo && \ libsecret-1-dev \
echo "**** install code-server ****" && \ pkg-config && \
if [ -z ${CODE_RELEASE+x} ]; then \ echo "**** install runtime dependencies ****" && \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ apt-get install -y \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \ git \
fi && \ jq \
mkdir -p /app/code-server && \ nano \
curl -o \ net-tools \
/tmp/code-server.tar.gz -L \ nodejs \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" && \ sudo \
tar xf /tmp/code-server.tar.gz -C \ yarn && \
/app/code-server --strip-components=1 && \ echo "**** install code-server ****" && \
echo "**** patch 4.0.2 ****" && \ if [ -z ${CODE_RELEASE+x} ]; then \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \ CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
cd /app/code-server && \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
npm i --production @node-rs/argon2; \ fi && \
fi && \ CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
echo "**** clean up ****" && \ yarn --production --frozen-lockfile global add code-server@"$CODE_VERSION" && \
apt-get purge --auto-remove -y \ yarn cache clean && \
build-essential \ echo "**** clean up ****" && \
nodejs && \ apt-get purge --auto-remove -y \
apt-get clean && \ build-essential \
rm -rf \ libx11-dev \
/config/* \ libxkbfile-dev \
/tmp/* \ libsecret-1-dev \
/var/lib/apt/lists/* \ pkg-config && \
/var/tmp/* \ apt-get clean && \
/etc/apt/sources.list.d/nodesource.list rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY /root / COPY /root /

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-focal FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-bionic
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -11,50 +11,53 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ RUN \
echo "**** install node repo ****" && \ echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ apt-get update && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \ apt-get install -y \
> /etc/apt/sources.list.d/nodesource.list && \ gnupg && \
echo "**** install build dependencies ****" && \ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-get update && \ echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
apt-get install -y \ > /etc/apt/sources.list.d/nodesource.list && \
build-essential \ curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
nodejs && \ echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
echo "**** install runtime dependencies ****" && \ > /etc/apt/sources.list.d/yarn.list && \
apt-get install -y \ echo "**** install build dependencies ****" && \
git \ apt-get update && \
jq \ apt-get install -y \
libatomic1 \ build-essential \
nano \ libx11-dev \
net-tools \ libxkbfile-dev \
sudo && \ libsecret-1-dev \
echo "**** install code-server ****" && \ pkg-config && \
if [ -z ${CODE_RELEASE+x} ]; then \ echo "**** install runtime dependencies ****" && \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ apt-get install -y \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \ git \
fi && \ jq \
mkdir -p /app/code-server && \ nano \
curl -o \ net-tools \
/tmp/code-server.tar.gz -L \ nodejs \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-arm64.tar.gz" && \ sudo \
tar xf /tmp/code-server.tar.gz -C \ yarn && \
/app/code-server --strip-components=1 && \ echo "**** install code-server ****" && \
echo "**** patch 4.0.2 ****" && \ if [ -z ${CODE_RELEASE+x} ]; then \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \ CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
cd /app/code-server && \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
npm i --production @node-rs/argon2; \ fi && \
fi && \ CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
echo "**** clean up ****" && \ yarn --production --frozen-lockfile global add code-server@"$CODE_VERSION" && \
apt-get purge --auto-remove -y \ yarn cache clean && \
build-essential \ echo "**** clean up ****" && \
nodejs && \ apt-get purge --auto-remove -y \
apt-get clean && \ build-essential \
rm -rf \ libx11-dev \
/config/* \ libxkbfile-dev \
/tmp/* \ libsecret-1-dev \
/var/lib/apt/lists/* \ pkg-config && \
/var/tmp/* \ apt-get clean && \
/etc/apt/sources.list.d/nodesource.list rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY /root / COPY /root /

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-focal FROM ghcr.io/linuxserver/baseimage-ubuntu:arm32v7-bionic
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -11,50 +11,53 @@ LABEL maintainer="aptalca"
ENV HOME="/config" ENV HOME="/config"
RUN \ RUN \
echo "**** install node repo ****" && \ echo "**** install node repo ****" && \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ apt-get update && \
echo 'deb https://deb.nodesource.com/node_14.x focal main' \ apt-get install -y \
> /etc/apt/sources.list.d/nodesource.list && \ gnupg && \
echo "**** install build dependencies ****" && \ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-get update && \ echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
apt-get install -y \ > /etc/apt/sources.list.d/nodesource.list && \
build-essential \ curl -s https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
nodejs && \ echo 'deb https://dl.yarnpkg.com/debian/ stable main' \
echo "**** install runtime dependencies ****" && \ > /etc/apt/sources.list.d/yarn.list && \
apt-get install -y \ echo "**** install build dependencies ****" && \
git \ apt-get update && \
jq \ apt-get install -y \
libatomic1 \ build-essential \
nano \ libx11-dev \
net-tools \ libxkbfile-dev \
sudo && \ libsecret-1-dev \
echo "**** install code-server ****" && \ pkg-config && \
if [ -z ${CODE_RELEASE+x} ]; then \ echo "**** install runtime dependencies ****" && \
CODE_RELEASE=$(curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest \ apt-get install -y \
| awk '/tag_name/{print $4;exit}' FS='[""]' | sed 's|^v||'); \ git \
fi && \ jq \
mkdir -p /app/code-server && \ nano \
curl -o \ net-tools \
/tmp/code-server.tar.gz -L \ nodejs \
"https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-armv7l.tar.gz" && \ sudo \
tar xf /tmp/code-server.tar.gz -C \ yarn && \
/app/code-server --strip-components=1 && \ echo "**** install code-server ****" && \
echo "**** patch 4.0.2 ****" && \ if [ -z ${CODE_RELEASE+x} ]; then \
if [ "${CODE_RELEASE}" = "4.0.2" ] && [ "$(uname -m)" != "x86_64" ]; then \ CODE_RELEASE=$(curl -sX GET "https://api.github.com/repos/cdr/code-server/releases/latest" \
cd /app/code-server && \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \
npm i --production @node-rs/argon2; \ fi && \
fi && \ CODE_VERSION=$(echo "$CODE_RELEASE" | awk '{print substr($1,2); }') && \
echo "**** clean up ****" && \ yarn --production --frozen-lockfile global add code-server@"$CODE_VERSION" && \
apt-get purge --auto-remove -y \ yarn cache clean && \
build-essential \ echo "**** clean up ****" && \
nodejs && \ apt-get purge --auto-remove -y \
apt-get clean && \ build-essential \
rm -rf \ libx11-dev \
/config/* \ libxkbfile-dev \
/tmp/* \ libsecret-1-dev \
/var/lib/apt/lists/* \ pkg-config && \
/var/tmp/* \ apt-get clean && \
/etc/apt/sources.list.d/nodesource.list rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY /root / COPY /root /

357
Jenkinsfile vendored
View File

@ -16,7 +16,9 @@ pipeline {
GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab')
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
GITLAB_NAMESPACE=credentials('gitlab-namespace-id') GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
SCARF_TOKEN=credentials('scarf_api_key') EXT_GIT_BRANCH = 'master'
EXT_USER = 'cdr'
EXT_REPO = 'code-server'
CONTAINER_NAME = 'code-server' CONTAINER_NAME = 'code-server'
BUILD_VERSION_ARG = 'CODE_RELEASE' BUILD_VERSION_ARG = 'CODE_RELEASE'
LS_USER = 'linuxserver' LS_USER = 'linuxserver'
@ -56,7 +58,7 @@ pipeline {
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
env.PULL_REQUEST = env.CHANGE_ID env.PULL_REQUEST = env.CHANGE_ID
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/stale.yml ./.github/workflows/external_trigger.yml ./.github/workflows/package_trigger.yml' env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml'
} }
script{ script{
env.LS_RELEASE_NUMBER = sh( env.LS_RELEASE_NUMBER = sh(
@ -99,16 +101,23 @@ pipeline {
/* ######################## /* ########################
External Release Tagging External Release Tagging
######################## */ ######################## */
// If this is a custom command to determine version use that command // If this is a stable github release use the latest endpoint from github to determine the ext tag
stage("Set tag custom bash"){ stage("Set ENV github_stable"){
steps{ steps{
script{ script{
env.EXT_RELEASE = sh( env.EXT_RELEASE = sh(
script: ''' curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||' ''', script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
returnStdout: true).trim() returnStdout: true).trim()
env.RELEASE_LINK = 'custom_command' }
} }
} }
// If this is a stable or devel github release generate the link for the build message
stage("Set ENV github_link"){
steps{
script{
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE
}
}
} }
// Sanitize the release tag and strip illegal docker or github characters // Sanitize the release tag and strip illegal docker or github characters
stage("Sanitize tag"){ stage("Sanitize tag"){
@ -117,30 +126,6 @@ pipeline {
env.EXT_RELEASE_CLEAN = sh( env.EXT_RELEASE_CLEAN = sh(
script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''', script: '''echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g' ''',
returnStdout: true).trim() returnStdout: true).trim()
def semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)\.(\d+)/
if (semver.find()) {
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}"
} else {
semver = env.EXT_RELEASE_CLEAN =~ /(\d+)\.(\d+)(?:\.(\d+))?(.*)/
if (semver.find()) {
if (semver[0][3]) {
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${semver[0][3]}"
} else if (!semver[0][3] && !semver[0][4]) {
env.SEMVER = "${semver[0][1]}.${semver[0][2]}.${(new Date()).format('YYYYMMdd')}"
}
}
}
if (env.SEMVER != null) {
if (BRANCH_NAME != "master" && BRANCH_NAME != "main") {
env.SEMVER = "${env.SEMVER}-${BRANCH_NAME}"
}
println("SEMVER: ${env.SEMVER}")
} else {
println("No SEMVER detected")
}
} }
} }
} }
@ -155,13 +140,11 @@ pipeline {
env.IMAGE = env.DOCKERHUB_IMAGE env.IMAGE = env.DOCKERHUB_IMAGE
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME
env.QUAYIMAGE = 'quay.io/linuxserver.io/' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { if (env.MULTIARCH == 'true') {
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
} }
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
} }
@ -178,13 +161,11 @@ pipeline {
env.IMAGE = env.DEV_DOCKERHUB_IMAGE env.IMAGE = env.DEV_DOCKERHUB_IMAGE
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME
env.QUAYIMAGE = 'quay.io/linuxserver.io/lsiodev-' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { if (env.MULTIARCH == 'true') {
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
} }
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
@ -201,13 +182,11 @@ pipeline {
env.IMAGE = env.PR_DOCKERHUB_IMAGE env.IMAGE = env.PR_DOCKERHUB_IMAGE
env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME
env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME
env.QUAYIMAGE = 'quay.io/linuxserver.io/lspipepr-' + env.CONTAINER_NAME
if (env.MULTIARCH == 'true') { if (env.MULTIARCH == 'true') {
env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
} else { } else {
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
} }
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
@ -259,65 +238,18 @@ pipeline {
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
docker pull ghcr.io/linuxserver/jenkins-builder:latest docker pull ghcr.io/linuxserver/jenkins-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
# Stage 1 - Jenkinsfile update
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
cd ${TEMPDIR}/repo/${LS_REPO}
git checkout -f master
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile ${TEMPDIR}/repo/${LS_REPO}/
git add Jenkinsfile
git commit -m 'Bot Updating Templated Files'
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "Updating Jenkinsfile"
rm -Rf ${TEMPDIR}
exit 0
else
echo "Jenkinsfile is up to date."
fi
# Stage 2 - Delete old templates
OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md"
for i in ${OLD_TEMPLATES}; do
if [[ -f "${i}" ]]; then
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
fi
done
if [[ -n "${TEMPLATES_TO_DELETE}" ]]; then
mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
cd ${TEMPDIR}/repo/${LS_REPO}
git checkout -f master
for i in ${TEMPLATES_TO_DELETE}; do
git rm "${i}"
done
git commit -m 'Bot Updating Templated Files'
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
echo "Deleting old templates"
rm -Rf ${TEMPDIR}
exit 0
else
echo "No templates to delete"
fi
# Stage 3 - Update templates
CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
cd ${TEMPDIR}/docker-${CONTAINER_NAME} cd ${TEMPDIR}/docker-${CONTAINER_NAME}
NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8)
if [[ "${CURRENTHASH}" != "${NEWHASH}" ]] || ! grep -q '.jenkins-external' "${WORKSPACE}/.gitignore" 2>/dev/null; then if [[ "${CURRENTHASH}" != "${NEWHASH}" ]]; then
mkdir -p ${TEMPDIR}/repo mkdir -p ${TEMPDIR}/repo
git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
cd ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO}
git checkout -f master git checkout -f master
cd ${TEMPDIR}/docker-${CONTAINER_NAME} cd ${TEMPDIR}/docker-${CONTAINER_NAME}
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
cd ${TEMPDIR}/repo/${LS_REPO}/ cd ${TEMPDIR}/repo/${LS_REPO}/
if ! grep -q '.jenkins-external' .gitignore 2>/dev/null; then
echo ".jenkins-external" >> .gitignore
git add .gitignore
fi
git add ${TEMPLATED_FILES} git add ${TEMPLATED_FILES}
git commit -m 'Bot Updating Templated Files' git commit -m 'Bot Updating Templated Files'
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
@ -327,34 +259,13 @@ pipeline {
fi fi
mkdir -p ${TEMPDIR}/gitbook mkdir -p ${TEMPDIR}/gitbook
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/ cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
cd ${TEMPDIR}/gitbook/docker-documentation/ cd ${TEMPDIR}/gitbook/docker-documentation/
git add images/docker-${CONTAINER_NAME}.md git add images/docker-${CONTAINER_NAME}.md
git commit -m 'Bot Updating Documentation' git commit -m 'Bot Updating Documentation'
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
fi fi
mkdir -p ${TEMPDIR}/unraid
git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates
git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates
if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-logo.png ]]; then
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-logo.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml
fi
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
cd ${TEMPDIR}/unraid/templates/
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
echo "Image is on the ignore list, marking Unraid template as deprecated"
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
git add -u unraid/${CONTAINER_NAME}.xml
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
git commit -m 'Bot Moving Deprecated Unraid Template' || :
else
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
git add unraid/${CONTAINER_NAME}.xml
git commit -m 'Bot Updating Unraid Template'
fi
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all
fi
rm -Rf ${TEMPDIR}''' rm -Rf ${TEMPDIR}'''
script{ script{
env.FILES_UPDATED = sh( env.FILES_UPDATED = sh(
@ -399,94 +310,31 @@ pipeline {
"visibility":"public"}' ''' "visibility":"public"}' '''
} }
} }
/* #######################
Scarf.sh package registry
####################### */
// Add package to Scarf.sh and set permissions
stage("Scarf.sh package registry"){
when {
branch "master"
environment name: 'EXIT_STATUS', value: ''
}
steps{
sh '''#! /bin/bash
set -e
PACKAGE_UUID=$(curl -X GET -H "Authorization: Bearer ${SCARF_TOKEN}" https://scarf.sh/api/v1/organizations/linuxserver-ci/packages | jq -r '.[] | select(.name=="linuxserver/code-server") | .uuid')
if [ -z "${PACKAGE_UUID}" ]; then
echo "Adding package to Scarf.sh"
curl -sX POST https://scarf.sh/api/v1/organizations/linuxserver-ci/packages \
-H "Authorization: Bearer ${SCARF_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"name":"linuxserver/code-server",\
"shortDescription":"example description",\
"libraryType":"docker",\
"website":"https://github.com/linuxserver/docker-code-server",\
"backendUrl":"https://ghcr.io/linuxserver/code-server",\
"publicUrl":"https://lscr.io/linuxserver/code-server"}' || :
else
echo "Package already exists on Scarf.sh"
fi
'''
}
}
/* ############### /* ###############
Build Container Build Container
############### */ ############### */
// Build Docker container for push to LS Repo // Build Docker container for push to LS Repo
stage('Build-Single') { stage('Build-Single') {
when { when {
expression { environment name: 'MULTIARCH', value: 'false'
env.MULTIARCH == 'false' || params.PACKAGE_CHECK == 'true'
}
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
} }
steps { steps {
echo "Running on node: ${NODE_NAME}" sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
sh "docker build \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
--label \"org.opencontainers.image.authors=linuxserver.io\" \
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-code-server/packages\" \
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-code-server\" \
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-code-server\" \
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.title=Code-server\" \
--label \"org.opencontainers.image.description=[Code-server](https://coder.com) is VS Code running on a remote server, accessible through the browser. - Code on your Chromebook, tablet, and laptop with a consistent dev environment. - If you have a Windows or Mac workstation, more easily develop for Linux. - Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. - Preserve battery life when you're on the go. - All intensive computation runs on your server. - You're no longer running excess instances of Chrome.\" \
--no-cache --pull -t ${IMAGE}:${META_TAG} \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
} }
} }
// Build MultiArch Docker containers for push to LS Repo // Build MultiArch Docker containers for push to LS Repo
stage('Build-Multi') { stage('Build-Multi') {
when { when {
allOf { environment name: 'MULTIARCH', value: 'true'
environment name: 'MULTIARCH', value: 'true'
expression { params.PACKAGE_CHECK == 'false' }
}
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
} }
parallel { parallel {
stage('Build X86') { stage('Build X86') {
steps { steps {
echo "Running on node: ${NODE_NAME}" sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
sh "docker build \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
--label \"org.opencontainers.image.authors=linuxserver.io\" \
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-code-server/packages\" \
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-code-server\" \
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-code-server\" \
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.title=Code-server\" \
--label \"org.opencontainers.image.description=[Code-server](https://coder.com) is VS Code running on a remote server, accessible through the browser. - Code on your Chromebook, tablet, and laptop with a consistent dev environment. - If you have a Windows or Mac workstation, more easily develop for Linux. - Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. - Preserve battery life when you're on the go. - All intensive computation runs on your server. - You're no longer running excess instances of Chrome.\" \
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
} }
} }
stage('Build ARMHF') { stage('Build ARMHF') {
@ -494,26 +342,12 @@ pipeline {
label 'ARMHF' label 'ARMHF'
} }
steps { steps {
echo "Running on node: ${NODE_NAME}"
echo 'Logging into Github' echo 'Logging into Github'
sh '''#! /bin/bash sh '''#! /bin/bash
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
''' '''
sh "docker build \ sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
--label \"org.opencontainers.image.authors=linuxserver.io\" \
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-code-server/packages\" \
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-code-server\" \
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-code-server\" \
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.title=Code-server\" \
--label \"org.opencontainers.image.description=[Code-server](https://coder.com) is VS Code running on a remote server, accessible through the browser. - Code on your Chromebook, tablet, and laptop with a consistent dev environment. - If you have a Windows or Mac workstation, more easily develop for Linux. - Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. - Preserve battery life when you're on the go. - All intensive computation runs on your server. - You're no longer running excess instances of Chrome.\" \
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
retry(5) { retry(5) {
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
@ -528,26 +362,12 @@ pipeline {
label 'ARM64' label 'ARM64'
} }
steps { steps {
echo "Running on node: ${NODE_NAME}"
echo 'Logging into Github' echo 'Logging into Github'
sh '''#! /bin/bash sh '''#! /bin/bash
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
''' '''
sh "docker build \ sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \ --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
--label \"org.opencontainers.image.authors=linuxserver.io\" \
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-code-server/packages\" \
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-code-server\" \
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-code-server\" \
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
--label \"org.opencontainers.image.title=Code-server\" \
--label \"org.opencontainers.image.description=[Code-server](https://coder.com) is VS Code running on a remote server, accessible through the browser. - Code on your Chromebook, tablet, and laptop with a consistent dev environment. - If you have a Windows or Mac workstation, more easily develop for Linux. - Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. - Preserve battery life when you're on the go. - All intensive computation runs on your server. - You're no longer running excess instances of Chrome.\" \
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
retry(5) { retry(5) {
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
@ -570,7 +390,7 @@ pipeline {
sh '''#! /bin/bash sh '''#! /bin/bash
set -e set -e
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then if [ "${MULTIARCH}" == "true" ]; then
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG} LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
else else
LOCAL_CONTAINER=${IMAGE}:${META_TAG} LOCAL_CONTAINER=${IMAGE}:${META_TAG}
@ -585,15 +405,6 @@ pipeline {
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \ apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \ sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
chmod 777 /tmp/package_versions.txt' chmod 777 /tmp/package_versions.txt'
elif [ "${DIST_IMAGE}" == "fedora" ]; then
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
rpm -qa > /tmp/package_versions.txt && \
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
chmod 777 /tmp/package_versions.txt'
elif [ "${DIST_IMAGE}" == "arch" ]; then
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
pacman -Q > /tmp/package_versions.txt && \
chmod 777 /tmp/package_versions.txt'
fi fi
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 ) NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
@ -629,13 +440,6 @@ pipeline {
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
} }
steps { steps {
sh '''#! /bin/bash
echo "Packages were updated. Cleaning up the image and exiting."
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
docker rmi ${IMAGE}:amd64-${META_TAG}
else
docker rmi ${IMAGE}:${META_TAG}
fi'''
script{ script{
env.EXIT_STATUS = 'ABORTED' env.EXIT_STATUS = 'ABORTED'
} }
@ -653,13 +457,6 @@ pipeline {
} }
} }
steps { steps {
sh '''#! /bin/bash
echo "There are no package updates. Cleaning up the image and exiting."
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
docker rmi ${IMAGE}:amd64-${META_TAG}
else
docker rmi ${IMAGE}:${META_TAG}
fi'''
script{ script{
env.EXIT_STATUS = 'ABORTED' env.EXIT_STATUS = 'ABORTED'
} }
@ -684,7 +481,7 @@ pipeline {
} }
sh '''#! /bin/bash sh '''#! /bin/bash
set -e set -e
docker pull ghcr.io/linuxserver/ci:latest docker pull ghcr.io/linuxserver/lsiodev-ci:latest
if [ "${MULTIARCH}" == "true" ]; then if [ "${MULTIARCH}" == "true" ]; then
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
@ -709,7 +506,7 @@ pipeline {
-e WEB_PATH=\"${CI_WEBPATH}\" \ -e WEB_PATH=\"${CI_WEBPATH}\" \
-e DO_REGION="ams3" \ -e DO_REGION="ams3" \
-e DO_BUCKET="lsio-ci" \ -e DO_BUCKET="lsio-ci" \
-t ghcr.io/linuxserver/ci:latest \ -t ghcr.io/linuxserver/lsiodev-ci:latest \
python /ci/ci.py''' python /ci/ci.py'''
} }
} }
@ -730,12 +527,6 @@ pipeline {
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
usernameVariable: 'DOCKERUSER', usernameVariable: 'DOCKERUSER',
passwordVariable: 'DOCKERPASS' passwordVariable: 'DOCKERPASS'
],
[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'Quay.io-Robot',
usernameVariable: 'QUAYUSER',
passwordVariable: 'QUAYPASS'
] ]
]) { ]) {
retry(5) { retry(5) {
@ -744,32 +535,22 @@ pipeline {
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do
docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG} docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG}
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG} docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG}
if [ -n "${SEMVER}" ]; then
docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${SEMVER}
fi
docker push ${PUSHIMAGE}:latest docker push ${PUSHIMAGE}:latest
docker push ${PUSHIMAGE}:${META_TAG} docker push ${PUSHIMAGE}:${META_TAG}
docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG} docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG}
if [ -n "${SEMVER}" ]; then
docker push ${PUSHIMAGE}:${SEMVER}
fi
done done
''' '''
} }
sh '''#! /bin/bash sh '''#! /bin/bash
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
docker rmi \ docker rmi \
${DELETEIMAGE}:${META_TAG} \ ${DELETEIMAGE}:${META_TAG} \
${DELETEIMAGE}:${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:${EXT_RELEASE_TAG} \
${DELETEIMAGE}:latest || : ${DELETEIMAGE}:latest || :
if [ -n "${SEMVER}" ]; then
docker rmi ${DELETEIMAGE}:${SEMVER} || :
fi
done done
''' '''
} }
@ -788,12 +569,6 @@ pipeline {
credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207', credentialsId: '3f9ba4d5-100d-45b0-a3c4-633fd6061207',
usernameVariable: 'DOCKERUSER', usernameVariable: 'DOCKERUSER',
passwordVariable: 'DOCKERPASS' passwordVariable: 'DOCKERPASS'
],
[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'Quay.io-Robot',
usernameVariable: 'QUAYUSER',
passwordVariable: 'QUAYPASS'
] ]
]) { ]) {
retry(5) { retry(5) {
@ -802,14 +577,13 @@ pipeline {
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin
echo $QUAYPASS | docker login quay.io -u $QUAYUSER --password-stdin
if [ "${CI}" == "false" ]; then if [ "${CI}" == "false" ]; then
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}
docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} docker pull ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG} docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm32v7-${META_TAG}
docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG} docker tag ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} ${IMAGE}:arm64v8-${META_TAG}
fi fi
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}"; do
docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG}
docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG}
docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
@ -819,11 +593,6 @@ pipeline {
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
if [ -n "${SEMVER}" ]; then
docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${SEMVER}
docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${SEMVER}
docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
fi
docker push ${MANIFESTIMAGE}:amd64-${META_TAG} docker push ${MANIFESTIMAGE}:amd64-${META_TAG}
docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG} docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG}
docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG}
@ -833,11 +602,6 @@ pipeline {
docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG}
docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG}
docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
if [ -n "${SEMVER}" ]; then
docker push ${MANIFESTIMAGE}:amd64-${SEMVER}
docker push ${MANIFESTIMAGE}:arm32v7-${SEMVER}
docker push ${MANIFESTIMAGE}:arm64v8-${SEMVER}
fi
docker manifest push --purge ${MANIFESTIMAGE}:latest || : docker manifest push --purge ${MANIFESTIMAGE}:latest || :
docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest
docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm
@ -846,43 +610,24 @@ pipeline {
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8 docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || :
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8 docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
if [ -n "${SEMVER}" ]; then
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER} || :
docker manifest create ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:amd64-${SEMVER} ${MANIFESTIMAGE}:arm32v7-${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER}
docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm32v7-${SEMVER} --os linux --arch arm
docker manifest annotate ${MANIFESTIMAGE}:${SEMVER} ${MANIFESTIMAGE}:arm64v8-${SEMVER} --os linux --arch arm64 --variant v8
fi
docker manifest push --purge ${MANIFESTIMAGE}:latest docker manifest push --purge ${MANIFESTIMAGE}:latest
docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG}
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG}
if [ -n "${SEMVER}" ]; then
docker manifest push --purge ${MANIFESTIMAGE}:${SEMVER}
fi
done done
''' '''
} }
sh '''#! /bin/bash sh '''#! /bin/bash
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${QUAYIMAGE}" "${IMAGE}"; do for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
docker rmi \ docker rmi \
${DELETEIMAGE}:amd64-${META_TAG} \ ${DELETEIMAGE}:amd64-${META_TAG} \
${DELETEIMAGE}:amd64-latest \ ${DELETEIMAGE}:amd64-latest \
${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \
${DELETEIMAGE}:arm32v7-${META_TAG} \ ${DELETEIMAGE}:arm32v7-${META_TAG} \
${DELETEIMAGE}:arm32v7-latest \ ${DELETEIMAGE}:arm32v7-latest \
${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \
${DELETEIMAGE}:arm64v8-${META_TAG} \ ${DELETEIMAGE}:arm64v8-${META_TAG} \
${DELETEIMAGE}:arm64v8-latest \ ${DELETEIMAGE}:arm64v8-latest || :
${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || :
if [ -n "${SEMVER}" ]; then
docker rmi \
${DELETEIMAGE}:amd64-${SEMVER} \
${DELETEIMAGE}:arm32v7-${SEMVER} \
${DELETEIMAGE}:arm64v8-${SEMVER} || :
fi
done done
docker rmi \ docker rmi \
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \ ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
@ -902,20 +647,20 @@ pipeline {
environment name: 'EXIT_STATUS', value: '' environment name: 'EXIT_STATUS', value: ''
} }
steps { steps {
echo "Pushing New tag for current commit ${META_TAG}" echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
-d '{"tag":"'${META_TAG}'",\ -d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"object": "'${COMMIT_SHA}'",\ "object": "'${COMMIT_SHA}'",\
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\ "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
"type": "commit",\ "type": "commit",\
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
echo "Pushing New release for Tag" echo "Pushing New release for Tag"
sh '''#! /bin/bash sh '''#! /bin/bash
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
echo '{"tag_name":"'${META_TAG}'",\ echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"target_commitish": "master",\ "target_commitish": "master",\
"name": "'${META_TAG}'",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**Remote Changes:**\\n\\n' > start "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
printf '","draft": false,"prerelease": false}' >> releasebody.json printf '","draft": false,"prerelease": false}' >> releasebody.json
paste -d'\\0' start releasebody.json > releasebody.json.done paste -d'\\0' start releasebody.json > releasebody.json.done
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
@ -941,7 +686,7 @@ pipeline {
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
docker pull ghcr.io/linuxserver/jenkins-builder:latest docker pull ghcr.io/linuxserver/jenkins-builder:latest
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
docker pull ghcr.io/linuxserver/readme-sync docker pull ghcr.io/linuxserver/lsiodev-readme-sync
docker run --rm=true \ docker run --rm=true \
-e DOCKERHUB_USERNAME=$DOCKERUSER \ -e DOCKERHUB_USERNAME=$DOCKERUSER \
-e DOCKERHUB_PASSWORD=$DOCKERPASS \ -e DOCKERHUB_PASSWORD=$DOCKERPASS \
@ -949,7 +694,7 @@ pipeline {
-e DOCKER_REPOSITORY=${IMAGE} \ -e DOCKER_REPOSITORY=${IMAGE} \
-e GIT_BRANCH=master \ -e GIT_BRANCH=master \
-v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \ -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \
ghcr.io/linuxserver/readme-sync bash -c 'node sync' ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
rm -Rf ${TEMPDIR} ''' rm -Rf ${TEMPDIR} '''
} }
} }

132
README.md
View File

@ -1,5 +1,5 @@
<!-- DO NOT EDIT THIS FILE MANUALLY --> <!-- DO NOT EDIT THIS FILE MANUALLY -->
<!-- Please read the https://github.com/linuxserver/docker-code-server/blob/master/.github/CONTRIBUTING.md --> <!-- Please read the CONTRIBUTING.md -->
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io) [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
@ -12,14 +12,13 @@
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring: The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring:
* regular and timely application updates * regular and timely application updates
* easy user mappings (PGID, PUID) * easy user mappings (PGID, PUID)
* custom base image with s6 overlay * custom base image with s6 overlay
* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth * weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
* regular security updates * regular security updates
Find us at: Find us at:
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more! * [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team. * [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
* [Discourse](https://discourse.linuxserver.io) - post on our community forum. * [Discourse](https://discourse.linuxserver.io) - post on our community forum.
@ -29,12 +28,11 @@ Find us at:
# [linuxserver/code-server](https://github.com/linuxserver/docker-code-server) # [linuxserver/code-server](https://github.com/linuxserver/docker-code-server)
[![Scarf.io pulls](https://scarf.sh/installs-badge/linuxserver-ci/linuxserver%2Fcode-server?color=94398d&label-color=555555&logo-color=ffffff&style=for-the-badge&package-type=docker)](https://scarf.sh/gateway/linuxserver-ci/docker/linuxserver%2Fcode-server)
[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-code-server) [![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-code-server)
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-code-server/releases) [![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-code-server/releases)
[![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-code-server/packages) [![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-code-server/packages)
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-code-server/container_registry) [![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-code-server/container_registry)
[![Quay.io](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/code-server) [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/code-server "Get your own version badge on microbadger.com")
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/code-server) [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/code-server)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/code-server) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/code-server.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/code-server)
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-code-server%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/) [![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-code-server%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-code-server/job/master/)
@ -52,66 +50,49 @@ Find us at:
## Supported Architectures ## Supported Architectures
We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/). Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
Simply pulling `lscr.io/linuxserver/code-server:latest` should retrieve the correct image for your arch, but you can also pull specific arch images via tags. Simply pulling `ghcr.io/linuxserver/code-server` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
The architectures supported by this image are: The architectures supported by this image are:
| Architecture | Available | Tag | | Architecture | Tag |
| :----: | :----: | ---- | | :----: | --- |
| x86-64 | ✅ | amd64-\<version tag\> | | x86-64 | amd64-latest |
| arm64 | ✅ | arm64v8-\<version tag\> | | arm64 | arm64v8-latest |
| armhf| ✅ | arm32v7-\<version tag\> | | armhf | arm32v7-latest |
## Version Tags ## Version Tags
This image provides various versions that are available via tags. Please read the descriptions carefully and exercise caution when using unstable or development tags. This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them.
| Tag | Available | Description | | Tag | Description |
| :----: | :----: |--- | | :----: | --- |
| latest | ✅ | Stable releases | | latest | Stable releases |
| focal | ✅ | DEPRECATED (no longer updated, `latest` is rebased on focal) - Stable releases, based on Ubuntu Focal | | development | Prereleases from their GitHub |
| development | ✅ | DEPRECATED (no longer updated) - Prereleases from their GitHub |
## Application Setup
Access the webui at `http://<your-ip>:8443`.
For github integration, drop your ssh key in to `/config/.ssh`.
Then open a terminal from the top menu and set your github username and email via the following commands
```bash
git config --global user.name "username"
git config --global user.email "email address"
```
### Hashed code-server password
How to create the [hashed password](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed).
## Usage ## Usage
Here are some example snippets to help you get started creating a container. Here are some example snippets to help you get started creating a container.
### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose)) ### docker-compose ([recommended](https://docs.linuxserver.io/general/docker-compose))
Compatible with docker-compose v2 schemas.
```yaml ```yaml
--- ---
version: "2.1" version: "2.1"
services: services:
code-server: code-server:
image: lscr.io/linuxserver/code-server:latest image: ghcr.io/linuxserver/code-server
container_name: code-server container_name: code-server
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- TZ=Europe/London - TZ=Europe/London
- PASSWORD=password #optional - PASSWORD=password #optional
- HASHED_PASSWORD= #optional
- SUDO_PASSWORD=password #optional - SUDO_PASSWORD=password #optional
- SUDO_PASSWORD_HASH= #optional
- PROXY_DOMAIN=code-server.my.domain #optional - PROXY_DOMAIN=code-server.my.domain #optional
- DEFAULT_WORKSPACE=/config/workspace #optional
volumes: volumes:
- /path/to/appdata/config:/config - /path/to/appdata/config:/config
ports: ports:
@ -119,26 +100,24 @@ services:
restart: unless-stopped restart: unless-stopped
``` ```
### docker cli ([click here for more info](https://docs.docker.com/engine/reference/commandline/cli/)) ### docker cli
```bash ```
docker run -d \ docker run -d \
--name=code-server \ --name=code-server \
-e PUID=1000 \ -e PUID=1000 \
-e PGID=1000 \ -e PGID=1000 \
-e TZ=Europe/London \ -e TZ=Europe/London \
-e PASSWORD=password `#optional` \ -e PASSWORD=password `#optional` \
-e HASHED_PASSWORD= `#optional` \
-e SUDO_PASSWORD=password `#optional` \ -e SUDO_PASSWORD=password `#optional` \
-e SUDO_PASSWORD_HASH= `#optional` \
-e PROXY_DOMAIN=code-server.my.domain `#optional` \ -e PROXY_DOMAIN=code-server.my.domain `#optional` \
-e DEFAULT_WORKSPACE=/config/workspace `#optional` \
-p 8443:8443 \ -p 8443:8443 \
-v /path/to/appdata/config:/config \ -v /path/to/appdata/config:/config \
--restart unless-stopped \ --restart unless-stopped \
lscr.io/linuxserver/code-server:latest ghcr.io/linuxserver/code-server
``` ```
## Parameters ## Parameters
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container. Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
@ -149,12 +128,9 @@ Container images are configured using parameters passed at runtime (such as thos
| `-e PUID=1000` | for UserID - see below for explanation | | `-e PUID=1000` | for UserID - see below for explanation |
| `-e PGID=1000` | for GroupID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
| `-e PASSWORD=password` | Optional web gui password, if `PASSWORD` or `HASHED_PASSWORD` is not provided, there will be no auth. | | `-e PASSWORD=password` | Optional web gui password, if not provided, there will be no auth. |
| `-e HASHED_PASSWORD=` | Optional web gui password, overrides `PASSWORD`, instructions on how to create it is below. |
| `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. | | `-e SUDO_PASSWORD=password` | If this optional variable is set, user will have sudo access in the code-server terminal with the specified password. |
| `-e SUDO_PASSWORD_HASH=` | Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`. | | `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#sub-domains) |
| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains) |
| `-e DEFAULT_WORKSPACE=/config/workspace` | If this optional variable is set, code-server will open this directory by default |
| `-v /config` | Contains all relevant configuration files. | | `-v /config` | Contains all relevant configuration files. |
## Environment variables from files (Docker secrets) ## Environment variables from files (Docker secrets)
@ -163,7 +139,7 @@ You can set any environment variable from a file by using a special prepend `FIL
As an example: As an example:
```bash ```
-e FILE__PASSWORD=/run/secrets/mysecretpassword -e FILE__PASSWORD=/run/secrets/mysecretpassword
``` ```
@ -182,17 +158,30 @@ Ensure any volume directories on the host are owned by the same user you specify
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below: In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
```bash ```
$ id username $ id username
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup) uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
``` ```
## Docker Mods
&nbsp;
## Application Setup
Access the webui at `http://<your-ip>:8443`.
For github integration, drop your ssh key in to `/config/.ssh`.
Then open a terminal from the top menu and set your github username and email via the following commands
```
git config --global user.name "username"
git config --global user.email "email address"
```
## Docker Mods
[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=code-server&query=%24.mods%5B%27code-server%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=code-server "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.") [![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=code-server&query=%24.mods%5B%27code-server%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=code-server "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.")
We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above. We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.
## Support Info ## Support Info
* Shell access whilst the container is running: `docker exec -it code-server /bin/bash` * Shell access whilst the container is running: `docker exec -it code-server /bin/bash`
@ -200,7 +189,7 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to
* container version number * container version number
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' code-server` * `docker inspect -f '{{ index .Config.Labels "build_version" }}' code-server`
* image version number * image version number
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/code-server:latest` * `docker inspect -f '{{ index .Config.Labels "build_version" }}' ghcr.io/linuxserver/code-server`
## Updating Info ## Updating Info
@ -209,7 +198,6 @@ Most of our images are static, versioned, and require an image update and contai
Below are the instructions for updating containers: Below are the instructions for updating containers:
### Via Docker Compose ### Via Docker Compose
* Update all images: `docker-compose pull` * Update all images: `docker-compose pull`
* or update a single image: `docker-compose pull code-server` * or update a single image: `docker-compose pull code-server`
* Let compose update all containers as necessary: `docker-compose up -d` * Let compose update all containers as necessary: `docker-compose up -d`
@ -217,48 +205,41 @@ Below are the instructions for updating containers:
* You can also remove the old dangling images: `docker image prune` * You can also remove the old dangling images: `docker image prune`
### Via Docker Run ### Via Docker Run
* Update the image: `docker pull ghcr.io/linuxserver/code-server`
* Update the image: `docker pull lscr.io/linuxserver/code-server:latest`
* Stop the running container: `docker stop code-server` * Stop the running container: `docker stop code-server`
* Delete the container: `docker rm code-server` * Delete the container: `docker rm code-server`
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved) * Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
* You can also remove the old dangling images: `docker image prune` * You can also remove the old dangling images: `docker image prune`
### Via Watchtower auto-updater (only use if you don't remember the original parameters) ### Via Watchtower auto-updater (only use if you don't remember the original parameters)
* Pull the latest image at its tag and replace it with the same env variables in one run: * Pull the latest image at its tag and replace it with the same env variables in one run:
```
```bash
docker run --rm \ docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \ containrrr/watchtower \
--run-once code-server --run-once code-server
``` ```
* You can also remove the old dangling images: `docker image prune` * You can also remove the old dangling images: `docker image prune`
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose). **Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
### Image Update Notifications - Diun (Docker Image Update Notifier) ### Image Update Notifications - Diun (Docker Image Update Notifier)
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported. * We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
## Building locally ## Building locally
If you want to make local modifications to these images for development purposes or just to customize the logic: If you want to make local modifications to these images for development purposes or just to customize the logic:
```
```bash
git clone https://github.com/linuxserver/docker-code-server.git git clone https://github.com/linuxserver/docker-code-server.git
cd docker-code-server cd docker-code-server
docker build \ docker build \
--no-cache \ --no-cache \
--pull \ --pull \
-t lscr.io/linuxserver/code-server:latest . -t ghcr.io/linuxserver/code-server:latest .
``` ```
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static` The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
```
```bash
docker run --rm --privileged multiarch/qemu-user-static:register --reset docker run --rm --privileged multiarch/qemu-user-static:register --reset
``` ```
@ -266,15 +247,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions ## Versions
* **20.02.22:** - Install using the official tarballs.
* **29.12.21:** - Add `install-extension` as a helper for mods to install extensions.
* **06.12.21:** - Add `DEFAULT_WORKSPACE` env var.
* **29.11.21:** - Rebase to Ubuntu focal.
* **16.09.21:** - Fix slow `chown` on large workspace (contents of workspace folder no longer chowned).
* **11.07.21:** - Bump node to 14 to fix builds
* **08.05.21:** - Fix doc link
* **04.02.20:** - Allow setting gui password via hash using env var `HASHED_PASSWORD`.
* **23.12.20:** - Allow setting sudo password via hash using env var `SUDO_PASSWORD_HASH`.
* **29.05.20:** - Add --domain-proxy support. * **29.05.20:** - Add --domain-proxy support.
* **21.05.20:** - Shrink images, install via yarn, fix arm32v7 build. * **21.05.20:** - Shrink images, install via yarn, fix arm32v7 build.
* **18.05.20:** - Switch to multi-arch images, install via npm. * **18.05.20:** - Switch to multi-arch images, install via npm.

View File

@ -2,12 +2,14 @@
# jenkins variables # jenkins variables
project_name: docker-code-server project_name: docker-code-server
external_type: na external_type: github_stable
custom_version_command: "curl -sX GET https://api.github.com/repos/coder/code-server/releases/latest | jq -r '.tag_name' | sed 's|^v||'"
release_type: stable release_type: stable
release_tag: latest release_tag: latest
ls_branch: master ls_branch: master
repo_vars: repo_vars:
- EXT_GIT_BRANCH = 'master'
- EXT_USER = 'cdr'
- EXT_REPO = 'code-server'
- CONTAINER_NAME = 'code-server' - CONTAINER_NAME = 'code-server'
- BUILD_VERSION_ARG = 'CODE_RELEASE' - BUILD_VERSION_ARG = 'CODE_RELEASE'
- LS_USER = 'linuxserver' - LS_USER = 'linuxserver'

View File

@ -1,176 +1,185 @@
adduser3.118ubuntu2 adduser3.116ubuntu1
apt2.0.9 apt1.6.12ubuntu0.1
apt-utils2.0.9 apt-utils1.6.12ubuntu0.1
base-files11ubuntu5.5 base-files10.1ubuntu2.10
base-passwd3.5.47 base-passwd3.5.44
bash5.0-6ubuntu1.1 bash4.4.18-2ubuntu1.2
bsdutils1:2.34-0.1ubuntu9.3 bsdutils1:2.31.1-0.4ubuntu3.7
bzip21.0.8-2 bzip21.0.6-8.1ubuntu0.2
ca-certificates20211016~20.04.1 ca-certificates20201027ubuntu0.18.04.1
coreutils8.30-3ubuntu2 coreutils8.28-1ubuntu1
curl7.68.0-1ubuntu2.12 curl7.58.0-2ubuntu3.10
dash0.5.10.2-6 dash0.5.8-2.10
debconf1.5.73 debconf1.5.66ubuntu1
debianutils4.9.1 debianutils4.8.4
diffutils1:3.7-3 diffutils1:3.6-1
dirmngr2.2.19-3ubuntu2.2 dirmngr2.2.4-1ubuntu1.3
dpkg1.19.7ubuntu3 dpkg1.19.0.5ubuntu2.3
e2fsprogs1.45.5-2ubuntu1 e2fsprogs1.44.1-1ubuntu1.3
fdisk2.34-0.1ubuntu9.3 fdisk2.31.1-0.4ubuntu3.7
findutils4.7.0-1ubuntu1 file1:5.32-2ubuntu0.4
gcc-10-base10.3.0-1ubuntu1~20.04 findutils4.6.0+git+20170828-2
git1:2.25.1-1ubuntu3.5 gcc-8-base8.4.0-1ubuntu1~18.04
git-man1:2.25.1-1ubuntu3.5 git1:2.17.1-1ubuntu0.7
gnupg2.2.19-3ubuntu2.2 git-man1:2.17.1-1ubuntu0.7
gnupg-l10n2.2.19-3ubuntu2.2 gnupg2.2.4-1ubuntu1.3
gnupg-utils2.2.19-3ubuntu2.2 gnupg-l10n2.2.4-1ubuntu1.3
gpg2.2.19-3ubuntu2.2 gnupg-utils2.2.4-1ubuntu1.3
gpg-agent2.2.19-3ubuntu2.2 gpg2.2.4-1ubuntu1.3
gpgconf2.2.19-3ubuntu2.2 gpg-agent2.2.4-1ubuntu1.3
gpgsm2.2.19-3ubuntu2.2 gpgconf2.2.4-1ubuntu1.3
gpgv2.2.19-3ubuntu2.2 gpgsm2.2.4-1ubuntu1.3
gpg-wks-client2.2.19-3ubuntu2.2 gpgv2.2.4-1ubuntu1.3
gpg-wks-server2.2.19-3ubuntu2.2 gpg-wks-client2.2.4-1ubuntu1.3
grep3.4-1 gpg-wks-server2.2.4-1ubuntu1.3
gzip1.10-0ubuntu4 grep3.1-2build1
hostname3.23 gzip1.6-5ubuntu1
init-system-helpers1.57 hostname3.20
jq1.6-1ubuntu0.20.04.1 init-system-helpers1.51
krb5-locales1.17-6ubuntu4.1 jq1.5+dfsg-2
less551-1ubuntu0.1 krb5-locales1.16-2ubuntu0.1
libacl12.2.53-6 less487-0.1
libapt-pkg6.02.0.9 libacl12.2.52-3build1
libasn1-8-heimdal7.7.0+dfsg-1ubuntu1 libapt-inst2.01.6.12ubuntu0.1
libassuan02.5.3-7ubuntu2 libapt-pkg5.01.6.12ubuntu0.1
libatomic110.3.0-1ubuntu1~20.04 libasn1-8-heimdal7.5.0+dfsg-1
libattr11:2.4.48-5 libassuan02.5.1-2
libaudit11:2.8.5-2ubuntu6 libattr11:2.4.47-2build1
libaudit-common1:2.8.5-2ubuntu6 libaudit11:2.8.2-1ubuntu1
libblkid12.34-0.1ubuntu9.3 libaudit-common1:2.8.2-1ubuntu1
libbrotli11.0.7-6ubuntu0.1 libblkid12.31.1-0.4ubuntu3.7
libbsd00.10.0-1 libbsd00.8.7-1ubuntu0.1
libbz2-1.01.0.8-2 libbz2-1.01.0.6-8.1ubuntu0.2
libc62.31-0ubuntu9.9 libc62.27-3ubuntu1.3
libcap-ng00.7.9-2.1build1 libcap-ng00.7.7-3.1
libc-bin2.31-0ubuntu9.7 libc-bin2.27-3ubuntu1.2
libcbor0.60.6.0-0ubuntu1 libcom-err21.44.1-1ubuntu1.3
libcom-err21.45.5-2ubuntu1 libcurl3-gnutls7.58.0-2ubuntu3.10
libcrypt11:4.4.10-10ubuntu4 libcurl47.58.0-2ubuntu3.10
libcurl3-gnutls7.68.0-1ubuntu2.12 libdb5.35.3.28-13.1ubuntu1.1
libcurl47.68.0-1ubuntu2.12 libdebconfclient00.213ubuntu1
libdb5.35.3.28+dfsg1-0.6ubuntu2 libedit23.1-20170329-1
libdebconfclient00.251ubuntu1 liberror-perl0.17025-1
libedit23.1-20191231-1 libexpat12.2.5-3ubuntu0.2
liberror-perl0.17029-1 libext2fs21.44.1-1ubuntu1.3
libexpat12.2.9-1ubuntu0.4 libfdisk12.31.1-0.4ubuntu3.7
libext2fs21.45.5-2ubuntu1 libffi63.2.1-8
libfdisk12.34-0.1ubuntu9.3 libgcc11:8.4.0-1ubuntu1~18.04
libffi73.3-4 libgcrypt201.8.1-4ubuntu1.2
libfido2-11.3.1-1ubuntu2 libgdbm51.14.1-6
libgcc-s110.3.0-1ubuntu1~20.04 libgdbm-compat41.14.1-6
libgcrypt201.8.5-5ubuntu1.1 libgmp102:6.1.2+dfsg-2
libgdbm61.18.1-5 libgnutls303.5.18-1ubuntu1.4
libgdbm-compat41.18.1-5 libgpg-error01.27-6
libgmp102:6.2.0+dfsg-4 libgssapi3-heimdal7.5.0+dfsg-1
libgnutls303.6.13-2ubuntu1.6 libgssapi-krb5-21.16-2ubuntu0.1
libgpg-error01.37-1 libhcrypto4-heimdal7.5.0+dfsg-1
libgssapi3-heimdal7.7.0+dfsg-1ubuntu1 libheimbase1-heimdal7.5.0+dfsg-1
libgssapi-krb5-21.17-6ubuntu4.1 libheimntlm0-heimdal7.5.0+dfsg-1
libhcrypto4-heimdal7.7.0+dfsg-1ubuntu1 libhogweed43.4-1
libheimbase1-heimdal7.7.0+dfsg-1ubuntu1 libhx509-5-heimdal7.5.0+dfsg-1
libheimntlm0-heimdal7.7.0+dfsg-1ubuntu1 libidn2-02.0.4-1.1ubuntu0.2
libhogweed53.5.1+really3.5.1-2ubuntu0.2 libjq11.5+dfsg-2
libhx509-5-heimdal7.7.0+dfsg-1ubuntu1 libk5crypto31.16-2ubuntu0.1
libidn2-02.2.0-2 libkeyutils11.5.9-9.2ubuntu2
libjq11.6-1ubuntu0.20.04.1 libkrb5-26-heimdal7.5.0+dfsg-1
libk5crypto31.17-6ubuntu4.1 libkrb5-31.16-2ubuntu0.1
libkeyutils11.6-6ubuntu1.1 libkrb5support01.16-2ubuntu0.1
libkrb5-26-heimdal7.7.0+dfsg-1ubuntu1
libkrb5-31.17-6ubuntu4.1
libkrb5support01.17-6ubuntu4.1
libksba81.3.5-2 libksba81.3.5-2
libldap-2.4-22.4.49+dfsg-2ubuntu1.9 libldap-2.4-22.4.45+dfsg-1ubuntu1.6
libldap-common2.4.49+dfsg-2ubuntu1.9 libldap-common2.4.45+dfsg-1ubuntu1.6
liblz4-11.9.2-2ubuntu0.20.04.1 liblz4-10.0~r131-2ubuntu3
liblzma55.2.4-1ubuntu1 liblzma55.2.2-1.3
libmount12.34-0.1ubuntu9.3 libmagic11:5.32-2ubuntu0.4
libncurses66.2-0ubuntu2 libmagic-mgc1:5.32-2ubuntu0.4
libncursesw66.2-0ubuntu2 libmount12.31.1-0.4ubuntu3.7
libnettle73.5.1+really3.5.1-2ubuntu0.2 libncurses56.1-1ubuntu1.18.04
libnghttp2-141.40.0-1build1 libncursesw56.1-1ubuntu1.18.04
libnpth01.6-1 libnettle63.4-1
libonig56.9.4-1 libnghttp2-141.30.0-1ubuntu1
libp11-kit00.23.20-1ubuntu0.1 libnpth01.5-3
libpam0g1.3.1-5ubuntu4.3 libonig46.7.0-1
libpam-modules1.3.1-5ubuntu4.3 libp11-kit00.23.9-2
libpam-modules-bin1.3.1-5ubuntu4.3 libpam0g1.1.8-3.6ubuntu2.18.04.2
libpam-runtime1.3.1-5ubuntu4.3 libpam-modules1.1.8-3.6ubuntu2.18.04.2
libpcre2-8-010.34-7 libpam-modules-bin1.1.8-3.6ubuntu2.18.04.2
libpcre32:8.39-12build1 libpam-runtime1.1.8-3.6ubuntu2.18.04.2
libperl5.305.30.0-9ubuntu0.2 libpcre32:8.39-9
libprocps82:3.3.16-1ubuntu2.3 libperl5.265.26.1-6ubuntu0.5
libpsl50.21.0-1ubuntu1 libprocps62:3.3.12-3ubuntu1.2
libreadline88.0-4 libpsl50.19.1-5build1
libroken18-heimdal7.7.0+dfsg-1ubuntu1 libpython2.7-minimal2.7.17-1~18.04ubuntu1.2
librtmp12.4+20151223.gitfa8646d.1-2build1 libpython2.7-stdlib2.7.17-1~18.04ubuntu1.2
libsasl2-22.1.27+dfsg-2ubuntu0.1 libpython-stdlib2.7.15~rc1-1
libsasl2-modules2.1.27+dfsg-2ubuntu0.1 libreadline77.0-3
libsasl2-modules-db2.1.27+dfsg-2ubuntu0.1 libroken18-heimdal7.5.0+dfsg-1
libseccomp22.5.1-1ubuntu1~20.04.2 librtmp12.4+20151223.gitfa8646d.1-1
libselinux13.0-1build2 libsasl2-22.1.27~101-g0780600+dfsg-3ubuntu2.1
libsemanage13.0-1build2 libsasl2-modules2.1.27~101-g0780600+dfsg-3ubuntu2.1
libsemanage-common3.0-1build2 libsasl2-modules-db2.1.27~101-g0780600+dfsg-3ubuntu2.1
libsepol13.0-1 libseccomp22.4.3-1ubuntu3.18.04.3
libsmartcols12.34-0.1ubuntu9.3 libselinux12.7-2build2
libsqlite3-03.31.1-4ubuntu0.3 libsemanage12.7-2build2
libss21.45.5-2ubuntu1 libsemanage-common2.7-2build2
libssh-40.9.3-2ubuntu2.2 libsepol12.7-1
libssl1.11.1.1f-1ubuntu2.16 libsmartcols12.31.1-0.4ubuntu3.7
libstdc++610.3.0-1ubuntu1~20.04 libsqlite3-03.22.0-1ubuntu0.4
libsystemd0245.4-4ubuntu3.15 libss21.44.1-1ubuntu1.3
libtasn1-64.16.0-2 libssl1.0.01.0.2n-1ubuntu5.4
libtinfo66.2-0ubuntu2 libssl1.11.1.1-1ubuntu2.1~18.04.6
libudev1245.4-4ubuntu3.15 libstdc++68.4.0-1ubuntu1~18.04
libunistring20.9.10-2 libsystemd0237-3ubuntu10.42
libuuid12.34-0.1ubuntu9.3 libtasn1-64.13-2
libwind0-heimdal7.7.0+dfsg-1ubuntu1 libtinfo56.1-1ubuntu1.18.04
libx11-62:1.6.9-2ubuntu1.2 libudev1237-3ubuntu10.42
libx11-data2:1.6.9-2ubuntu1.2 libunistring20.9.9-0ubuntu2
libxau61:1.0.9-0ubuntu1 libuuid12.31.1-0.4ubuntu3.7
libxcb11.14-2 libwind0-heimdal7.5.0+dfsg-1
libxdmcp61:1.1.3-0ubuntu1 libx11-62:1.6.4-3ubuntu0.3
libxext62:1.3.4-0ubuntu1 libx11-data2:1.6.4-3ubuntu0.3
libxmuu12:1.1.3-0ubuntu1 libxau61:1.0.8-1ubuntu1
libzstd11.4.4+dfsg-3ubuntu0.1 libxcb11.13-2~ubuntu18.04
locales2.31-0ubuntu9.9 libxdmcp61:1.1.2-3
login1:4.8.1-1ubuntu5.20.04.1 libxext62:1.3.3-1
logsave1.45.5-2ubuntu1 libxmuu12:1.1.2-2
lsb-base11.1.0ubuntu2 libzstd11.3.3+dfsg-2ubuntu1.1
mawk1.3.4.20200120-2 locales2.27-3ubuntu1.2
mount2.34-0.1ubuntu9.3 login1:4.5-1ubuntu2
nano4.8-1ubuntu1 lsb-base9.20170808ubuntu1
ncurses-base6.2-0ubuntu2 mawk1.3.3-17ubuntu3
ncurses-bin6.2-0ubuntu2 mime-support3.60ubuntu1
netbase6.1 mount2.31.1-0.4ubuntu3.7
net-tools1.60+git20180626.aebd88e-1ubuntu1 multiarch-support2.27-3ubuntu1.3
openssh-client1:8.2p1-4ubuntu0.5 nano2.9.3-2
openssl1.1.1f-1ubuntu2.16 ncurses-base6.1-1ubuntu1.18.04
passwd1:4.8.1-1ubuntu5.20.04.1 ncurses-bin6.1-1ubuntu1.18.04
patch2.7.6-6 netbase5.4
perl5.30.0-9ubuntu0.2 net-tools1.60+git20161116.90da8a0-1ubuntu1
perl-base5.30.0-9ubuntu0.2 nodejs12.19.0-1nodesource1
perl-modules-5.305.30.0-9ubuntu0.2 openssh-client1:7.6p1-4ubuntu0.3
pinentry-curses1.1.0-3build1 openssl1.1.1-1ubuntu2.1~18.04.6
procps2:3.3.16-1ubuntu2.3 passwd1:4.5-1ubuntu2
publicsuffix20200303.0012-1 patch2.7.6-2ubuntu1.1
readline-common8.0-4 perl5.26.1-6ubuntu0.5
sed4.7-1 perl-base5.26.1-6ubuntu0.5
sensible-utils0.0.12+nmu1 perl-modules-5.265.26.1-6ubuntu0.5
sudo1.8.31-1ubuntu1.2 pinentry-curses1.1.0-1
sysvinit-utils2.96-2.1ubuntu1 procps2:3.3.12-3ubuntu1.2
tar1.30+dfsg-7ubuntu0.20.04.2 publicsuffix20180223.1310-1
tzdata2022a-0ubuntu0.20.04 python2.7.15~rc1-1
ubuntu-keyring2020.02.11.4 python2.72.7.17-1~18.04ubuntu1.2
util-linux2.34-0.1ubuntu9.3 python2.7-minimal2.7.17-1~18.04ubuntu1.2
xauth1:1.1-0ubuntu1 python-minimal2.7.15~rc1-1
zlib1g1:1.2.11.dfsg-2ubuntu1.2 readline-common7.0-3
sed4.4-2
sensible-utils0.0.12
sudo1.8.21p2-3ubuntu1.3
sysvinit-utils2.88dsf-59.10ubuntu1
tar1.29b-2ubuntu0.1
tzdata2020d-0ubuntu0.18.04
ubuntu-keyring2018.09.18.1~18.04.0
util-linux2.31.1-0.4ubuntu3.7
xauth1:1.0.10-1
xz-utils5.2.2-1.3
yarn1.22.5-1
zlib1g1:1.2.11.dfsg-0ubuntu2

View File

@ -29,8 +29,7 @@ available_architectures:
development_versions: true development_versions: true
development_versions_items: development_versions_items:
- { tag: "latest", desc: "Stable releases" } - { tag: "latest", desc: "Stable releases" }
- { tag: "focal", desc: "DEPRECATED (no longer updated, `latest` is rebased on focal) - Stable releases, based on Ubuntu Focal" } - { tag: "development", desc: "Prereleases from their GitHub" }
- { tag: "development", desc: "DEPRECATED (no longer updated) - Prereleases from their GitHub" }
# container parameters # container parameters
common_param_env_vars_enabled: true common_param_env_vars_enabled: true
@ -43,17 +42,14 @@ param_ports:
- { external_port: "8443", internal_port: "8443", port_desc: "web gui" } - { external_port: "8443", internal_port: "8443", port_desc: "web gui" }
param_usage_include_env: true param_usage_include_env: true
param_env_vars: param_env_vars:
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London" } - { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
# optional container parameters # optional container parameters
opt_param_usage_include_env: true opt_param_usage_include_env: true
opt_param_env_vars: opt_param_env_vars:
- { env_var: "PASSWORD", env_value: "password", desc: "Optional web gui password, if `PASSWORD` or `HASHED_PASSWORD` is not provided, there will be no auth." } - { env_var: "PASSWORD", env_value: "password", desc: "Optional web gui password, if not provided, there will be no auth."}
- { env_var: "HASHED_PASSWORD", env_value: "", desc: "Optional web gui password, overrides `PASSWORD`, instructions on how to create it is below." } - { env_var: "SUDO_PASSWORD", env_value: "password", desc: "If this optional variable is set, user will have sudo access in the code-server terminal with the specified password."}
- { env_var: "SUDO_PASSWORD", env_value: "password", desc: "If this optional variable is set, user will have sudo access in the code-server terminal with the specified password." } - { env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/doc/FAQ.md#sub-domains)" }
- { env_var: "SUDO_PASSWORD_HASH", env_value: "", desc: "Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`." }
- { env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains)" }
- { env_var: "DEFAULT_WORKSPACE", env_value: "/config/workspace", desc: "If this optional variable is set, code-server will open this directory by default" }
optional_block_1: false optional_block_1: false
optional_block_1_items: "" optional_block_1_items: ""
@ -64,29 +60,15 @@ app_setup_block: |
Access the webui at `http://<your-ip>:8443`. Access the webui at `http://<your-ip>:8443`.
For github integration, drop your ssh key in to `/config/.ssh`. For github integration, drop your ssh key in to `/config/.ssh`.
Then open a terminal from the top menu and set your github username and email via the following commands Then open a terminal from the top menu and set your github username and email via the following commands
```
```bash
git config --global user.name "username" git config --global user.name "username"
git config --global user.email "email address" git config --global user.email "email address"
``` ```
### Hashed code-server password
How to create the [hashed password](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed).
# changelog # changelog
changelogs: changelogs:
- { date: "20.02.22:", desc: "Install using the official tarballs." } - { date: "29.05.20:", desc: "Add --domain-proxy support."}
- { date: "29.12.21:", desc: "Add `install-extension` as a helper for mods to install extensions." }
- { date: "06.12.21:", desc: "Add `DEFAULT_WORKSPACE` env var." }
- { date: "29.11.21:", desc: "Rebase to Ubuntu focal." }
- { date: "16.09.21:", desc: "Fix slow `chown` on large workspace (contents of workspace folder no longer chowned)." }
- { date: "11.07.21:", desc: "Bump node to 14 to fix builds" }
- { date: "08.05.21:", desc: "Fix doc link" }
- { date: "04.02.20:", desc: "Allow setting gui password via hash using env var `HASHED_PASSWORD`." }
- { date: "23.12.20:", desc: "Allow setting sudo password via hash using env var `SUDO_PASSWORD_HASH`." }
- { date: "29.05.20:", desc: "Add --domain-proxy support." }
- { date: "21.05.20:", desc: "Shrink images, install via yarn, fix arm32v7 build." } - { date: "21.05.20:", desc: "Shrink images, install via yarn, fix arm32v7 build." }
- { date: "18.05.20:", desc: "Switch to multi-arch images, install via npm." } - { date: "18.05.20:", desc: "Switch to multi-arch images, install via npm." }
- { date: "29.04.20:", desc: "Update start arguments." } - { date: "29.04.20:", desc: "Update start arguments." }

View File

@ -2,41 +2,16 @@
mkdir -p /config/{extensions,data,workspace,.ssh} mkdir -p /config/{extensions,data,workspace,.ssh}
if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then if [ -n "${SUDO_PASSWORD}" ]; then
echo "setting up sudo access" echo "setting up sudo access"
if ! grep -q 'abc' /etc/sudoers; then if ! grep -q 'abc' /etc/sudoers; then
echo "adding abc to sudoers" echo "adding abc to sudoers"
echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers
fi fi
if [ -n "${SUDO_PASSWORD_HASH}" ]; then echo "setting sudo password"
echo "setting sudo password using sudo password hash" echo -e "${SUDO_PASSWORD}\n${SUDO_PASSWORD}" | passwd abc
sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow
else
echo "setting sudo password using SUDO_PASSWORD env var"
echo -e "${SUDO_PASSWORD}\n${SUDO_PASSWORD}" | passwd abc
fi
fi fi
[[ ! -f /config/.bashrc ]] && \
cp /root/.bashrc /config/.bashrc
[[ ! -f /config/.profile ]] && \
cp /root/.profile /config/.profile
# permissions # permissions
if [ -f "/usr/bin/find" ] && [ -f "/usr/bin/xargs" ]; then chown -R abc:abc \
CORES=$(nproc --all) /config
# Split workload between config and workspace
echo "setting permissions::configuration"
find /config -path /config/workspace -prune -false -o -type d -print0 | \
xargs --null -r --max-args=1 --max-procs=$((CORES*2*8)) \
chown -R abc:abc
echo "setting permissions::workspace"
chown abc:abc /config/workspace
else
# Set permissions on data mount
# do not decend into the workspace
chown -R abc:abc "$(ls /config -I workspace)"
chown abc:abc /config/workspace
fi

View File

@ -1,25 +1,25 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then if [ -n "${PASSWORD}" ]; then
AUTH="password" AUTH="password"
else else
AUTH="none" AUTH="none"
echo "starting with no password" echo "starting with no password"
fi fi
if [ -z ${PROXY_DOMAIN+x} ]; then if [ -z ${PROXY_DOMAIN+x} ]; then
PROXY_DOMAIN_ARG="" PROXY_DOMAIN_ARG=""
else else
PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}" PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}"
fi fi
exec \ exec \
s6-setuidgid abc \ s6-setuidgid abc \
/app/code-server/bin/code-server \ /usr/local/bin/code-server \
--bind-addr 0.0.0.0:8443 \ --bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \ --user-data-dir /config/data \
--extensions-dir /config/extensions \ --extensions-dir /config/extensions \
--disable-telemetry \ --disable-telemetry \
--auth "${AUTH}" \ --auth "${AUTH}" \
"${PROXY_DOMAIN_ARG}" \ "${PROXY_DOMAIN_ARG}" \
"${DEFAULT_WORKSPACE:-/config/workspace}" /config/workspace

View File

@ -1,10 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
_install=(/app/code-server/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension")
if [ "$(whoami)" == "abc" ]; then
"${_install[@]}" "$@"
else
s6-setuidgid abc "${_install[@]}" "$@"
fi