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

Commit 5b94567

Browse files
committed
adding alpine version of baseimage
1 parent 81b91e5 commit 5b94567

File tree

9 files changed

+283
-342
lines changed

9 files changed

+283
-342
lines changed

.github/workflows/external_trigger.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
external-trigger-master:
7+
external-trigger-alpine:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: External Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/alpine'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE }}" ]; then
16+
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER\". ****"
19+
echo "**** External trigger running off of alpine branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE\". ****"
2020
echo "**** Retrieving external version ****"
2121
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/linuxserver/gclient/releases/latest" | jq -r '. | .tag_name')
2222
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
2323
echo "**** Can't retrieve external version, exiting ****"
24-
FAILURE_REASON="Can't retrieve external version for baseimage-rdesktop-web branch master"
24+
FAILURE_REASON="Can't retrieve external version for baseimage-rdesktop-web branch alpine"
2525
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-baseimage-rdesktop-web/actions/runs/${{ github.run_id }}"
2626
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
2727
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
@@ -32,7 +32,7 @@ jobs:
3232
echo "**** External version: ${EXT_RELEASE} ****"
3333
echo "**** Retrieving last pushed version ****"
3434
image="linuxserver/baseimage-rdesktop-web"
35-
tag="bionic"
35+
tag="alpine"
3636
token=$(curl -sX GET \
3737
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fbaseimage-rdesktop-web%3Apull" \
3838
| jq -r '.token')
@@ -54,7 +54,7 @@ jobs:
5454
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
5555
if [ -z "${IMAGE_VERSION}" ]; then
5656
echo "**** Can't retrieve last pushed version, exiting ****"
57-
FAILURE_REASON="Can't retrieve last pushed version for baseimage-rdesktop-web tag bionic"
57+
FAILURE_REASON="Can't retrieve last pushed version for baseimage-rdesktop-web tag alpine"
5858
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
5959
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
6060
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
@@ -64,13 +64,13 @@ jobs:
6464
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
6565
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
6666
exit 0
67-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
67+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/alpine/lastBuild/api/json | jq -r '.building') == "true" ]; then
6868
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
6969
exit 0
7070
else
7171
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
7272
response=$(curl -iX POST \
73-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/master/buildWithParameters?PACKAGE_CHECK=false \
73+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/alpine/buildWithParameters?PACKAGE_CHECK=false \
7474
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
7575
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
7676
echo "**** Sleeping 10 seconds until job starts ****"
@@ -85,7 +85,7 @@ jobs:
8585
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
8686
--data-urlencode "Submit=Submit"
8787
echo "**** Notifying Discord ****"
88-
TRIGGER_REASON="A version change was detected for baseimage-rdesktop-web tag bionic. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
88+
TRIGGER_REASON="A version change was detected for baseimage-rdesktop-web tag alpine. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
8989
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
9090
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
9191
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}

.github/workflows/package_trigger.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
package-trigger-master:
7+
package-trigger-alpine:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2.3.3
1111

1212
- name: Package Trigger
13-
if: github.ref == 'refs/heads/master'
13+
if: github.ref == 'refs/heads/alpine'
1414
run: |
15-
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER }}" ]; then
16-
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER is set; skipping trigger. ****"
15+
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE }}" ]; then
16+
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE is set; skipping trigger. ****"
1717
exit 0
1818
fi
19-
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
19+
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/alpine/lastBuild/api/json | jq -r '.building') == "true" ]; then
2020
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
2121
exit 0
2222
fi
23-
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_MASTER\". ****"
23+
echo "**** Package trigger running off of alpine branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_BASEIMAGE_RDESKTOP_WEB_ALPINE\". ****"
2424
response=$(curl -iX POST \
25-
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/master/buildWithParameters?PACKAGE_CHECK=true \
25+
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-baseimage-rdesktop-web/job/alpine/buildWithParameters?PACKAGE_CHECK=true \
2626
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
2727
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
2828
echo "**** Sleeping 10 seconds until job starts ****"

Dockerfile

Lines changed: 70 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,74 @@
1-
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic as builder
1+
# guacamole builder
2+
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as guacbuilder
23

34
ARG GUACD_VERSION=1.1.0
45

5-
COPY /buildroot /
6-
76
RUN \
87
echo "**** install build deps ****" && \
9-
apt-get update && \
10-
apt-get install -qy --no-install-recommends \
8+
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
9+
ossp-uuid-dev && \
10+
apk add --no-cache \
11+
cairo-dev \
12+
libjpeg-turbo-dev \
13+
libpng-dev \
14+
ffmpeg-dev \
15+
freerdp-dev \
16+
openssl-dev \
17+
pulseaudio-dev \
18+
libvorbis-dev \
19+
libwebp-dev \
20+
perl \
21+
cunit-dev \
1122
autoconf \
1223
automake \
13-
checkinstall \
14-
freerdp2-dev \
15-
g++ \
16-
gcc \
17-
git \
18-
libavcodec-dev \
19-
libavutil-dev \
20-
libcairo2-dev \
21-
libjpeg-turbo8-dev \
22-
libogg-dev \
23-
libossp-uuid-dev \
24-
libpulse-dev \
25-
libssl-dev \
26-
libswscale-dev \
27-
libtool \
28-
libvorbis-dev \
29-
libwebsockets-dev \
30-
libwebp-dev \
31-
make
24+
alpine-sdk
3225

3326
RUN \
34-
echo "**** prep build ****" && \
35-
mkdir /tmp/guacd && \
36-
git clone https://github.com/apache/guacamole-server.git /tmp/guacd && \
37-
echo "**** build guacd ****" && \
38-
cd /tmp/guacd && \
39-
git checkout ${GUACD_VERSION} && \
40-
autoreconf -fi && \
41-
./configure --prefix=/usr && \
42-
make -j 2 && \
43-
mkdir -p /tmp/out && \
44-
/usr/bin/list-dependencies.sh \
45-
"/tmp/guacd/src/guacd/.libs/guacd" \
46-
$(find /tmp/guacd | grep "so$") \
47-
> /tmp/out/DEPENDENCIES && \
48-
PREFIX=/usr checkinstall \
49-
-y \
50-
-D \
51-
--nodoc \
52-
--pkgname guacd \
53-
--pkgversion "${GUACD_VERSION}" \
54-
--pakdir /tmp \
55-
--exclude "/usr/share/man","/usr/include","/etc" && \
56-
mkdir -p /tmp/out && \
57-
mv \
58-
/tmp/guacd_${GUACD_VERSION}-*.deb \
59-
/tmp/out/guacd_${GUACD_VERSION}.deb
27+
echo "**** compile guacamole ****" && \
28+
mkdir /buildout && \
29+
mkdir /tmp/guac && \
30+
cd /tmp/guac && \
31+
wget \
32+
http://apache.org/dyn/closer.cgi?action=download\&filename=guacamole/${GUACD_VERSION}/source/guacamole-server-${GUACD_VERSION}.tar.gz \
33+
-O guac.tar.gz && \
34+
tar -xf guac.tar.gz && \
35+
cd guacamole-server-${GUACD_VERSION} && \
36+
./configure \
37+
--disable-guacenc \
38+
--disable-guaclog \
39+
--prefix=/usr \
40+
--sysconfdir=/etc \
41+
--mandir=/usr/share/man \
42+
--localstatedir=/var \
43+
--enable-static \
44+
--with-libavcodec \
45+
--with-libavutil \
46+
--with-libswscale \
47+
--with-ssl \
48+
--without-winsock \
49+
--with-vorbis \
50+
--with-pulse \
51+
--without-pango \
52+
--without-terminal \
53+
--without-vnc \
54+
--with-rdp \
55+
--without-ssh \
56+
--without-telnet \
57+
--with-webp \
58+
--without-websockets && \
59+
make && \
60+
make DESTDIR=/buildout install
6061

6162
# nodejs builder
62-
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic as nodebuilder
63+
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as nodebuilder
6364
ARG GCLIENT_RELEASE
6465

6566
RUN \
6667
echo "**** install build deps ****" && \
67-
apt-get update && \
68-
apt-get install -y \
69-
gnupg && \
70-
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
71-
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
72-
> /etc/apt/sources.list.d/nodesource.list && \
73-
apt-get update && \
74-
apt-get install -y \
75-
nodejs
68+
apk add --no-cache \
69+
curl \
70+
nodejs \
71+
npm
7672

7773
RUN \
7874
echo "**** grab source ****" && \
@@ -91,53 +87,37 @@ RUN \
9187
RUN \
9288
echo "**** install node modules ****" && \
9389
cd /gclient && \
94-
npm install
90+
npm install
9591

9692
# runtime stage
97-
FROM ghcr.io/linuxserver/baseimage-rdesktop:bionic
93+
FROM ghcr.io/linuxserver/baseimage-rdesktop:alpine
9894

9995
# set version label
10096
ARG BUILD_DATE
10197
ARG VERSION
102-
ARG GUACD_VERSION=1.1.0
10398
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10499
LABEL maintainer="thelamer"
105100

106101
# Copy build outputs
107-
COPY --from=builder /tmp/out /tmp/out
108102
COPY --from=nodebuilder /gclient /gclient
103+
COPY --from=guacbuilder /buildout /
109104

110-
RUN \
111-
echo "**** install guacd ****" && \
112-
dpkg --path-include=/usr/share/doc/${PKG_NAME}/* \
113-
-i /tmp/out/guacd_${GUACD_VERSION}.deb && \
105+
RUN \
114106
echo "**** install packages ****" && \
115-
apt-get update && \
116-
apt-get install -y \
117-
gnupg && \
118-
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
119-
echo 'deb https://deb.nodesource.com/node_12.x bionic main' \
120-
> /etc/apt/sources.list.d/nodesource.list && \
121-
apt-get update && \
122-
DEBIAN_FRONTEND=noninteractive \
123-
apt-get install --no-install-recommends -y \
107+
apk add --no-cache \
124108
ca-certificates \
125-
libfreerdp2-2 \
126-
libfreerdp-client2-2 \
127-
libossp-uuid16 \
109+
font-noto \
110+
freerdp-libs \
128111
nodejs \
129-
obconf \
130-
openbox \
131-
python \
132-
xterm && \
133-
apt-get install -qy --no-install-recommends \
134-
$(cat /tmp/out/DEPENDENCIES) && \
135-
cd /usr/bin && \
112+
openbox && \
113+
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
114+
ossp-uuid && \
115+
echo "**** openbox tweaks ****" && \
116+
sed -i \
117+
's/NLIMC/NLMC/g' \
118+
/etc/xdg/openbox/rc.xml && \
136119
echo "**** cleanup ****" && \
137-
apt-get autoclean && \
138120
rm -rf \
139-
/var/lib/apt/lists/* \
140-
/var/tmp/* \
141121
/tmp/*
142122

143123
# add local files

0 commit comments

Comments
 (0)