Skip to content

Commit e43883f

Browse files
authored
Merge pull request #128 from flcontainers/dev
fix 1.5.5 rights on guacd
2 parents b16982f + 11d3ccc commit e43883f

File tree

5 files changed

+67
-51
lines changed

5 files changed

+67
-51
lines changed

.github/workflows/docker-image-dev.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ on:
66
- cron: '35 2 * * *'
77
push:
88
branches: [ dev ]
9-
pull_request:
10-
branches: [ dev ]
119

1210

1311
# permissions are needed if pushing to ghcr.io
14-
permissions:
12+
permissions:
1513
packages: write
1614

1715
jobs:
@@ -41,7 +39,9 @@ jobs:
4139
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
4240
restore-keys: |
4341
${{ runner.os }}-multi-buildx
44-
42+
43+
44+
4545
# Push to Docker Hub
4646
- name: Login to Docker Hub
4747
if: github.event_name != 'pull_request'

.github/workflows/docker-image.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Docker Image CI
33
on:
44
# Controls when the workflow will run
55
push:
6-
branches: [ main ]
76
tags:
87
- 'v*.*.*'
98

@@ -25,6 +24,14 @@ jobs:
2524
- name: Set up Docker Buildx
2625
id: buildx
2726
uses: docker/setup-buildx-action@v3
27+
- name: Cache Docker layers
28+
uses: actions/cache@v4
29+
with:
30+
path: /tmp/.buildx-cache
31+
# Key is named differently to avoid collision
32+
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
33+
restore-keys: |
34+
${{ runner.os }}-multi-buildx
2835
# Push to Docker Hub
2936
- name: Login to Docker Hub
3037
if: github.event_name != 'pull_request'
@@ -54,4 +61,14 @@ jobs:
5461
platforms: linux/amd64,linux/arm64/v8,linux/ppc64le
5562
push: ${{ github.event_name != 'pull_request' }}
5663
tags: ${{ steps.guac.outputs.tags }}
57-
labels: ${{ steps.guac.outputs.labels }}
64+
labels: ${{ steps.guac.outputs.labels }}
65+
cache-from: type=local,src=/tmp/.buildx-cache
66+
# Note the mode=max here
67+
# More: https://github.com/moby/buildkit#--export-cache-options
68+
# And: https://github.com/docker/buildx#--cache-tonametypetypekeyvalue
69+
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
70+
71+
- name: Move cache
72+
run: |
73+
rm -rf /tmp/.buildx-cache
74+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

Dockerfile

+41-43
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,35 @@ ENV \
1111
GUAC_VER=${VERSION}
1212

1313
# Install build dependencies
14-
RUN apk add --no-cache \
15-
alsa-lib-dev \
16-
alsa-tools-dev \
17-
autoconf \
18-
automake \
19-
build-base \
20-
cairo-dev \
21-
cjson-dev \
22-
cmake \
23-
cups-dev \
24-
cunit-dev \
25-
ffmpeg4-dev \
26-
git \
27-
grep \
28-
krb5-dev \
29-
libjpeg-turbo-dev \
30-
libpng-dev \
31-
libtool \
32-
libusb-dev \
33-
libwebp-dev \
34-
libxkbfile-dev \
35-
make \
36-
openssl-dev \
37-
pango-dev \
38-
pcsc-lite-dev \
39-
pulseaudio-dev \
40-
sdl2-dev \
41-
sdl2_ttf-dev \
42-
util-linux-dev \
43-
webkit2gtk-dev
14+
RUN apk add --no-cache \
15+
alsa-lib-dev \
16+
alsa-tools-dev \
17+
autoconf \
18+
automake \
19+
build-base \
20+
cairo-dev \
21+
cmake \
22+
cups-dev \
23+
faac-dev \
24+
faad2-dev \
25+
ffmpeg4-dev \
26+
git \
27+
grep \
28+
gsm-dev \
29+
gstreamer-dev \
30+
libjpeg-turbo-dev \
31+
libpng-dev \
32+
libtool \
33+
libusb-dev \
34+
libwebp-dev \
35+
libxkbfile-dev \
36+
make \
37+
openh264-dev \
38+
openssl-dev \
39+
pango-dev \
40+
pcsc-lite-dev \
41+
pulseaudio-dev \
42+
util-linux-dev
4443

4544

4645
# Copy source to container for sake of build
@@ -76,32 +75,28 @@ ARG WITH_LIBWEBSOCKETS='v\d+(\.\d+)+'
7675
ARG FREERDP_OPTS_COMMON="\
7776
-DBUILTIN_CHANNELS=OFF \
7877
-DCHANNEL_URBDRC=OFF \
79-
-DWITH_ALSA=OFF \
78+
-DWITH_ALSA=ON \
8079
-DWITH_CAIRO=ON \
8180
-DWITH_CHANNELS=ON \
8281
-DWITH_CLIENT=ON \
8382
-DWITH_CUPS=ON \
8483
-DWITH_DIRECTFB=OFF \
8584
-DWITH_FFMPEG=ON \
86-
-DWITH_FUSE=OFF \
87-
-DWITH_GSM=OFF \
85+
-DWITH_GSM=ON \
8886
-DWITH_GSSAPI=OFF \
8987
-DWITH_IPP=OFF \
9088
-DWITH_JPEG=ON \
91-
-DWITH_KRB5=ON \
9289
-DWITH_LIBSYSTEMD=OFF \
9390
-DWITH_MANPAGES=OFF \
94-
-DWITH_OPENH264=OFF \
91+
-DWITH_OPENH264=ON \
9592
-DWITH_OPENSSL=ON \
9693
-DWITH_OSS=OFF \
9794
-DWITH_PCSC=ON \
98-
-DWITH_PKCS11=OFF \
99-
-DWITH_PULSE=OFF \
95+
-DWITH_PULSE=ON \
10096
-DWITH_SERVER=OFF \
10197
-DWITH_SERVER_INTERFACE=OFF \
10298
-DWITH_SHADOW_MAC=OFF \
10399
-DWITH_SHADOW_X11=OFF \
104-
-DWITH_SWSCALE=OFF \
105100
-DWITH_WAYLAND=OFF \
106101
-DWITH_X11=OFF \
107102
-DWITH_X264=OFF \
@@ -224,9 +219,12 @@ RUN apk add --no-cache \
224219

225220
RUN apk add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing gosu
226221

227-
# Add user guacd
228-
RUN groupadd guacd && \
229-
useradd -s /bin/false -g guacd guacd
222+
# Create a new user guacd
223+
ARG UID=1000
224+
ARG GID=1000
225+
RUN groupadd --gid $GID guacd
226+
RUN useradd --system --create-home --shell /sbin/nologin --uid $UID --gid $GID guacd
227+
230228
RUN chown guacd:guacd -R ${PREFIX_DIR}
231229

232230
# Install tomcat
@@ -305,9 +303,9 @@ RUN chown tomcat:tomcat -R ${GUACAMOLE_HOME}
305303

306304
ENV PATH=/usr/lib/postgresql/${PG_MAJOR}/bin:$PATH
307305
ENV GUACAMOLE_HOME=/config/guacamole
308-
ENV CATALINA_PID=${CATALINA_HOME}/tomcat.pid
306+
ENV CATALINA_PID=/tmp/tomcat.pid
309307
ENV POSTGRES_PID=/config/postgresql/postmaster.pid
310-
ENV GUACD_PID=${PREFIX_DIR}/guacd.pid
308+
ENV GUACD_PID=/tmp/guacd.pid
311309

312310
# Copy files
313311
COPY filefs /

filefs/usr/local/bin/_startup.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ if [ -d "/config/guacamole/" ]; then
2424
cp -r /app/guacamole/schema /config/guacamole
2525
fi
2626
cp -rn /app/guacamole /config
27-
mkdir -p /root/.config/freerdp/known_hosts
27+
mkdir -p /home/guacd/.config/freerdp
28+
chown -R guacd:guacd /home/guacd/.config/freerdp
2829
chown -R tomcat:tomcat /config/guacamole
2930
chown -R tomcat:tomcat /opt/tomcat # Might help to fix issues with bug on tomcat logs
3031

scripts/guacd/wrapper_supervisor.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function shutdown()
99

1010
date
1111
echo "Starting Guacd"
12-
12+
HOME="/home/guacd"
1313
/opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -p $GUACD_PID -f
1414

1515
sleep 5

0 commit comments

Comments
 (0)