Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 1d86d3b

Browse files
committed
add ability to autostart applications
1 parent 19872b5 commit 1d86d3b

File tree

9 files changed

+106
-25
lines changed

9 files changed

+106
-25
lines changed

.github/CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
## Readme
2525

2626
If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
27-
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-baseimage-rdesktop-web/edit/master/readme-vars.yml).
27+
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-baseimage-rdesktop-web/edit/alpine/readme-vars.yml).
2828

2929
These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
3030
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io)
@@ -96,7 +96,7 @@ If you are proposing additional packages to be added, ensure that you added the
9696

9797
### Testing your changes
9898

99-
```
99+
```bash
100100
git clone https://github.com/linuxserver/docker-baseimage-rdesktop-web.git
101101
cd docker-baseimage-rdesktop-web
102102
docker build \
@@ -106,15 +106,16 @@ docker build \
106106
```
107107

108108
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
109-
```
109+
110+
```bash
110111
docker run --rm --privileged multiarch/qemu-user-static:register --reset
111112
```
112113

113114
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
114115

115-
## Update the chagelog
116+
## Update the changelog
116117

117-
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-baseimage-rdesktop-web/tree/master/root), add an entry to the changelog
118+
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-baseimage-rdesktop-web/tree/alpine/root), add an entry to the changelog
118119

119120
```yml
120121
changelogs:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
------------------------------
2323

24-
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
24+
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/alpine/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
2525

2626
------------------------------
2727

.github/workflows/greetings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/first-interaction@v1
1010
with:
11-
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
12-
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
11+
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/alpine/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/alpine/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
12+
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/alpine/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

Dockerfile.aarch64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

Dockerfile.armhf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ RUN \
111111
nodejs \
112112
openbox && \
113113
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114-
ossp-uuid && \
114+
ossp-uuid \
115+
websocat && \
115116
echo "**** openbox tweaks ****" && \
116117
sed -i \
117118
's/NLIMC/NLMC/g' \

Jenkinsfile

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pipeline {
5858
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
5959
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
6060
env.PULL_REQUEST = env.CHANGE_ID
61-
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.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/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger.yml ./.github/workflows/external_trigger_scheduler.yml'
61+
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.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'
6262
}
6363
script{
6464
env.LS_RELEASE_NUMBER = sh(
@@ -106,7 +106,7 @@ pipeline {
106106
steps{
107107
script{
108108
env.EXT_RELEASE = sh(
109-
script: '''curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
109+
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''',
110110
returnStdout: true).trim()
111111
}
112112
}
@@ -372,8 +372,21 @@ pipeline {
372372
}
373373
steps {
374374
echo "Running on node: ${NODE_NAME}"
375-
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
376-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
375+
sh "docker build \
376+
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
377+
--label \"org.opencontainers.image.authors=linuxserver.io\" \
378+
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-rdesktop-web/packages\" \
379+
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-rdesktop-web\" \
380+
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-rdesktop-web\" \
381+
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
382+
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
383+
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
384+
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
385+
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
386+
--label \"org.opencontainers.image.title=Baseimage-rdesktop-web\" \
387+
--label \"org.opencontainers.image.description=baseimage-rdesktop-web image by linuxserver.io\" \
388+
--no-cache --pull -t ${IMAGE}:${META_TAG} \
389+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
377390
}
378391
}
379392
// Build MultiArch Docker containers for push to LS Repo
@@ -386,8 +399,21 @@ pipeline {
386399
stage('Build X86') {
387400
steps {
388401
echo "Running on node: ${NODE_NAME}"
389-
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
390-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
402+
sh "docker build \
403+
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
404+
--label \"org.opencontainers.image.authors=linuxserver.io\" \
405+
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-rdesktop-web/packages\" \
406+
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-rdesktop-web\" \
407+
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-rdesktop-web\" \
408+
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
409+
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
410+
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
411+
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
412+
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
413+
--label \"org.opencontainers.image.title=Baseimage-rdesktop-web\" \
414+
--label \"org.opencontainers.image.description=baseimage-rdesktop-web image by linuxserver.io\" \
415+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
416+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
391417
}
392418
}
393419
stage('Build ARMHF') {
@@ -400,8 +426,21 @@ pipeline {
400426
sh '''#! /bin/bash
401427
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
402428
'''
403-
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
404-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
429+
sh "docker build \
430+
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
431+
--label \"org.opencontainers.image.authors=linuxserver.io\" \
432+
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-rdesktop-web/packages\" \
433+
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-rdesktop-web\" \
434+
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-rdesktop-web\" \
435+
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
436+
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
437+
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
438+
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
439+
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
440+
--label \"org.opencontainers.image.title=Baseimage-rdesktop-web\" \
441+
--label \"org.opencontainers.image.description=baseimage-rdesktop-web image by linuxserver.io\" \
442+
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
443+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
405444
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
406445
retry(5) {
407446
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -421,8 +460,21 @@ pipeline {
421460
sh '''#! /bin/bash
422461
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
423462
'''
424-
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
425-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
463+
sh "docker build \
464+
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
465+
--label \"org.opencontainers.image.authors=linuxserver.io\" \
466+
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-baseimage-rdesktop-web/packages\" \
467+
--label \"org.opencontainers.image.documentation=https://docs.linuxserver.io/images/docker-baseimage-rdesktop-web\" \
468+
--label \"org.opencontainers.image.source=https://github.com/linuxserver/docker-baseimage-rdesktop-web\" \
469+
--label \"org.opencontainers.image.version=${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}\" \
470+
--label \"org.opencontainers.image.revision=${COMMIT_SHA}\" \
471+
--label \"org.opencontainers.image.vendor=linuxserver.io\" \
472+
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
473+
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
474+
--label \"org.opencontainers.image.title=Baseimage-rdesktop-web\" \
475+
--label \"org.opencontainers.image.description=baseimage-rdesktop-web image by linuxserver.io\" \
476+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
477+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
426478
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
427479
retry(5) {
428480
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -712,11 +764,11 @@ pipeline {
712764
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
713765
echo "Pushing New release for Tag"
714766
sh '''#! /bin/bash
715-
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
767+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
716768
echo '{"tag_name":"'${META_TAG}'",\
717769
"target_commitish": "alpine",\
718770
"name": "'${META_TAG}'",\
719-
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
771+
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
720772
printf '","draft": false,"prerelease": true}' >> releasebody.json
721773
paste -d'\\0' start releasebody.json > releasebody.json.done
722774
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done'''
@@ -741,7 +793,7 @@ pipeline {
741793
set -e
742794
TEMPDIR=$(mktemp -d)
743795
docker pull ghcr.io/linuxserver/jenkins-builder:latest
744-
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
796+
docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH="${BRANCH_NAME}" -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest
745797
docker pull ghcr.io/linuxserver/readme-sync
746798
docker run --rm=true \
747799
-e DOCKERHUB_USERNAME=$DOCKERUSER \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- DO NOT EDIT THIS FILE MANUALLY -->
2-
<!-- Please read the CONTRIBUTING.md -->
2+
<!-- Please read the https://github.com/linuxserver/docker-baseimage-rdesktop-web/blob/alpine/.github/CONTRIBUTING.md -->
33

44
[linuxserverurl]: https://linuxserver.io
55
[forumurl]: https://forum.linuxserver.io

root/etc/services.d/autostart/run

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# just sleep if autostart is not enabled
4+
if [ -z ${GUIAUTOSTART+x} ]; then
5+
echo "[guac-init] Auto start not set, application start on login"
6+
sleep infinity
7+
# start abc session by sending a token to guacamole via websockets
8+
else
9+
# make sure services are up
10+
until \
11+
$(true &>/dev/null </dev/tcp/127.0.0.1/3350) && \
12+
$(true &>/dev/null </dev/tcp/127.0.0.1/4822) && \
13+
$(true &>/dev/null </dev/tcp/127.0.0.1/${CUSTOM_PORT:=3000}) &&
14+
$(true &>/dev/null </dev/tcp/127.0.0.1/3389)
15+
do
16+
sleep .5
17+
done
18+
echo "[guac-init] Auto start set, starting application"
19+
sleep 1
20+
# generate a token based on env vars
21+
cd /gclient
22+
TOKEN=$(node maketoken.js)
23+
websocat -q -n ws://localhost:${CUSTOM_PORT:=3000}/guaclite?token=${TOKEN}
24+
sleep infinity
25+
fi

0 commit comments

Comments
 (0)