2016-05-20 21:45:12 +00:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Dockerfile for guacamole-server
|
|
|
|
#
|
|
|
|
|
2022-08-15 06:35:39 +00:00
|
|
|
# The Alpine Linux image that should be used as the basis for the guacd image
|
|
|
|
ARG ALPINE_BASE_IMAGE=latest
|
|
|
|
FROM alpine:${ALPINE_BASE_IMAGE} AS builder
|
2017-12-06 12:57:12 +00:00
|
|
|
|
2022-08-15 06:35:39 +00:00
|
|
|
# Install build dependencies
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
build-base \
|
|
|
|
cairo-dev \
|
|
|
|
cmake \
|
|
|
|
git \
|
|
|
|
grep \
|
|
|
|
libjpeg-turbo-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libtool \
|
|
|
|
libwebp-dev \
|
|
|
|
make \
|
|
|
|
openssl-dev \
|
|
|
|
pango-dev \
|
|
|
|
pulseaudio-dev \
|
|
|
|
util-linux-dev
|
2020-12-24 19:57:13 +00:00
|
|
|
|
2022-08-15 06:35:39 +00:00
|
|
|
# Copy source to container for sake of build
|
|
|
|
ARG BUILD_DIR=/tmp/guacamole-server
|
|
|
|
COPY . ${BUILD_DIR}
|
2020-12-24 19:57:13 +00:00
|
|
|
|
|
|
|
#
|
2017-12-06 12:57:12 +00:00
|
|
|
# Base directory for installed build artifacts.
|
2020-12-24 19:57:13 +00:00
|
|
|
#
|
|
|
|
# NOTE: Due to limitations of the Docker image build process, this value is
|
2017-12-06 12:57:12 +00:00
|
|
|
# duplicated in an ARG in the second stage of the build.
|
|
|
|
#
|
2022-08-15 06:35:39 +00:00
|
|
|
ARG PREFIX_DIR=/opt/guacamole
|
|
|
|
|
|
|
|
#
|
|
|
|
# Automatically select the latest versions of each core protocol support
|
|
|
|
# library (these can be overridden at build time if a specific version is
|
|
|
|
# needed)
|
|
|
|
#
|
|
|
|
ARG WITH_FREERDP='2(\.\d+)+'
|
|
|
|
ARG WITH_LIBSSH2='libssh2-\d+(\.\d+)+'
|
|
|
|
ARG WITH_LIBTELNET='\d+(\.\d+)+'
|
|
|
|
ARG WITH_LIBVNCCLIENT='LibVNCServer-\d+(\.\d+)+'
|
|
|
|
ARG WITH_LIBWEBSOCKETS='v\d+(\.\d+)+'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Default build options for each core protocol support library, as well as
|
|
|
|
# guacamole-server itself (these can be overridden at build time if different
|
|
|
|
# options are needed)
|
|
|
|
#
|
|
|
|
|
|
|
|
ARG FREERDP_OPTS="\
|
|
|
|
-DBUILTIN_CHANNELS=OFF \
|
|
|
|
-DCHANNEL_URBDRC=OFF \
|
|
|
|
-DWITH_ALSA=OFF \
|
|
|
|
-DWITH_CAIRO=ON \
|
|
|
|
-DWITH_CHANNELS=ON \
|
|
|
|
-DWITH_CLIENT=ON \
|
|
|
|
-DWITH_CUPS=OFF \
|
|
|
|
-DWITH_DIRECTFB=OFF \
|
|
|
|
-DWITH_FFMPEG=OFF \
|
|
|
|
-DWITH_GSM=OFF \
|
|
|
|
-DWITH_GSSAPI=OFF \
|
|
|
|
-DWITH_IPP=OFF \
|
|
|
|
-DWITH_JPEG=ON \
|
|
|
|
-DWITH_LIBSYSTEMD=OFF \
|
|
|
|
-DWITH_MANPAGES=OFF \
|
|
|
|
-DWITH_OPENH264=OFF \
|
|
|
|
-DWITH_OPENSSL=ON \
|
|
|
|
-DWITH_OSS=OFF \
|
|
|
|
-DWITH_PCSC=OFF \
|
|
|
|
-DWITH_PULSE=OFF \
|
|
|
|
-DWITH_SERVER=OFF \
|
|
|
|
-DWITH_SERVER_INTERFACE=OFF \
|
|
|
|
-DWITH_SHADOW_MAC=OFF \
|
|
|
|
-DWITH_SHADOW_X11=OFF \
|
|
|
|
-DWITH_SSE2=ON \
|
|
|
|
-DWITH_WAYLAND=OFF \
|
|
|
|
-DWITH_X11=OFF \
|
|
|
|
-DWITH_X264=OFF \
|
|
|
|
-DWITH_XCURSOR=ON \
|
|
|
|
-DWITH_XEXT=ON \
|
|
|
|
-DWITH_XI=OFF \
|
|
|
|
-DWITH_XINERAMA=OFF \
|
|
|
|
-DWITH_XKBFILE=ON \
|
|
|
|
-DWITH_XRENDER=OFF \
|
|
|
|
-DWITH_XTEST=OFF \
|
|
|
|
-DWITH_XV=OFF \
|
|
|
|
-DWITH_ZLIB=ON"
|
|
|
|
|
|
|
|
ARG GUACAMOLE_SERVER_OPTS="\
|
|
|
|
--disable-guaclog"
|
|
|
|
|
|
|
|
ARG LIBSSH2_OPTS="\
|
|
|
|
-DBUILD_EXAMPLES=OFF \
|
|
|
|
-DBUILD_SHARED_LIBS=ON"
|
|
|
|
|
|
|
|
ARG LIBTELNET_OPTS="\
|
|
|
|
--disable-static \
|
|
|
|
--disable-util"
|
|
|
|
|
|
|
|
ARG LIBVNCCLIENT_OPTS=""
|
|
|
|
|
|
|
|
ARG LIBWEBSOCKETS_OPTS="\
|
|
|
|
-DDISABLE_WERROR=ON \
|
|
|
|
-DLWS_WITHOUT_SERVER=ON \
|
|
|
|
-DLWS_WITHOUT_TESTAPPS=ON \
|
|
|
|
-DLWS_WITHOUT_TEST_CLIENT=ON \
|
|
|
|
-DLWS_WITHOUT_TEST_PING=ON \
|
|
|
|
-DLWS_WITHOUT_TEST_SERVER=ON \
|
|
|
|
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
|
|
|
|
-DLWS_WITH_STATIC=OFF"
|
|
|
|
|
|
|
|
# Build guacamole-server and its core protocol library dependencies
|
|
|
|
RUN ${BUILD_DIR}/src/guacd-docker/bin/build-all.sh
|
2018-02-09 00:29:07 +00:00
|
|
|
|
|
|
|
# Record the packages of all runtime library dependencies
|
2022-08-15 06:35:39 +00:00
|
|
|
RUN ${BUILD_DIR}/src/guacd-docker/bin/list-dependencies.sh \
|
2020-12-24 19:57:13 +00:00
|
|
|
${PREFIX_DIR}/sbin/guacd \
|
|
|
|
${PREFIX_DIR}/lib/libguac-client-*.so \
|
|
|
|
${PREFIX_DIR}/lib/freerdp2/*guac*.so \
|
2018-02-09 00:29:07 +00:00
|
|
|
> ${PREFIX_DIR}/DEPENDENCIES
|
2016-05-20 21:45:12 +00:00
|
|
|
|
2022-08-15 06:35:39 +00:00
|
|
|
# Use same Alpine version as the base for the runtime image
|
|
|
|
FROM alpine:${ALPINE_BASE_IMAGE}
|
2020-12-24 19:57:13 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Base directory for installed build artifacts. See also the
|
2017-12-06 12:57:12 +00:00
|
|
|
# CMD directive at the end of this build stage.
|
|
|
|
#
|
2020-12-24 19:57:13 +00:00
|
|
|
# NOTE: Due to limitations of the Docker image build process, this value is
|
|
|
|
# duplicated in an ARG in the first stage of the build.
|
|
|
|
#
|
2022-08-15 06:35:39 +00:00
|
|
|
ARG PREFIX_DIR=/opt/guacamole
|
2017-12-06 12:57:12 +00:00
|
|
|
|
|
|
|
# Runtime environment
|
2018-04-02 05:05:06 +00:00
|
|
|
ENV LC_ALL=C.UTF-8
|
2018-04-02 04:50:41 +00:00
|
|
|
ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib
|
2018-03-28 23:54:07 +00:00
|
|
|
ENV GUACD_LOG_LEVEL=info
|
2017-12-06 12:57:12 +00:00
|
|
|
|
|
|
|
# Copy build artifacts into this stage
|
|
|
|
COPY --from=builder ${PREFIX_DIR} ${PREFIX_DIR}
|
|
|
|
|
2018-02-09 00:29:07 +00:00
|
|
|
# Bring runtime environment up to date and install runtime dependencies
|
2022-08-15 06:35:39 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
ca-certificates \
|
|
|
|
ghostscript \
|
|
|
|
netcat-openbsd \
|
|
|
|
shadow \
|
|
|
|
terminus-font \
|
|
|
|
ttf-dejavu \
|
|
|
|
ttf-liberation \
|
|
|
|
util-linux-login && \
|
|
|
|
xargs apk add --no-cache < ${PREFIX_DIR}/DEPENDENCIES
|
2017-12-06 12:57:12 +00:00
|
|
|
|
2020-06-25 15:51:29 +00:00
|
|
|
# Checks the operating status every 5 minutes with a timeout of 5 seconds
|
|
|
|
HEALTHCHECK --interval=5m --timeout=5s CMD nc -z 127.0.0.1 4822 || exit 1
|
|
|
|
|
2020-06-30 10:41:35 +00:00
|
|
|
# Create a new user guacd
|
|
|
|
ARG UID=1000
|
2020-12-07 09:35:06 +00:00
|
|
|
ARG GID=1000
|
|
|
|
RUN groupadd --gid $GID guacd
|
2022-08-15 06:35:39 +00:00
|
|
|
RUN useradd --system --create-home --shell /sbin/nologin --uid $UID --gid $GID guacd
|
2020-06-30 10:41:35 +00:00
|
|
|
|
|
|
|
# Run with user guacd
|
|
|
|
USER guacd
|
2020-06-25 15:51:29 +00:00
|
|
|
|
2017-12-06 12:57:12 +00:00
|
|
|
# Expose the default listener port
|
2016-05-20 21:45:12 +00:00
|
|
|
EXPOSE 4822
|
2017-12-06 12:57:12 +00:00
|
|
|
|
|
|
|
# Start guacd, listening on port 0.0.0.0:4822
|
|
|
|
#
|
|
|
|
# Note the path here MUST correspond to the value specified in the
|
|
|
|
# PREFIX_DIR build argument.
|
|
|
|
#
|
2022-08-15 06:35:39 +00:00
|
|
|
CMD /opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f
|
2016-05-20 21:45:12 +00:00
|
|
|
|