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
|
|
|
|
#
|
|
|
|
|
2017-12-06 12:57:12 +00:00
|
|
|
|
2018-04-02 04:24:50 +00:00
|
|
|
# Use Debian as base for the build
|
|
|
|
ARG DEBIAN_VERSION=stable
|
|
|
|
FROM debian:${DEBIAN_VERSION} AS builder
|
2017-12-06 12:57:12 +00:00
|
|
|
|
|
|
|
# Base directory for installed build artifacts.
|
|
|
|
# Due to limitations of the Docker image build process, this value is
|
|
|
|
# duplicated in an ARG in the second stage of the build.
|
|
|
|
#
|
|
|
|
ARG PREFIX_DIR=/usr/local/guacamole
|
|
|
|
|
|
|
|
# Build arguments
|
|
|
|
ARG BUILD_DIR=/tmp/guacd-docker-BUILD
|
|
|
|
ARG BUILD_DEPENDENCIES=" \
|
2016-08-26 19:56:41 +00:00
|
|
|
autoconf \
|
|
|
|
automake \
|
2019-11-05 03:26:04 +00:00
|
|
|
freerdp2-dev \
|
2016-08-26 19:56:41 +00:00
|
|
|
gcc \
|
2018-02-08 20:40:15 +00:00
|
|
|
libcairo2-dev \
|
2018-04-02 04:24:50 +00:00
|
|
|
libjpeg62-turbo-dev \
|
2018-02-08 20:40:15 +00:00
|
|
|
libossp-uuid-dev \
|
|
|
|
libpango1.0-dev \
|
|
|
|
libpulse-dev \
|
|
|
|
libssh2-1-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libtelnet-dev \
|
2016-08-26 19:56:41 +00:00
|
|
|
libtool \
|
2018-02-08 20:40:15 +00:00
|
|
|
libvncserver-dev \
|
2018-09-27 02:36:55 +00:00
|
|
|
libwebsockets-dev \
|
2018-02-08 20:40:15 +00:00
|
|
|
libwebp-dev \
|
|
|
|
make"
|
2016-05-20 21:45:12 +00:00
|
|
|
|
2017-12-06 12:57:12 +00:00
|
|
|
# Bring build environment up to date and install build dependencies
|
2018-02-08 20:40:15 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y $BUILD_DEPENDENCIES && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2016-05-20 21:45:12 +00:00
|
|
|
|
|
|
|
# Add configuration scripts
|
2018-02-09 00:29:07 +00:00
|
|
|
COPY src/guacd-docker/bin "${PREFIX_DIR}/bin/"
|
2016-05-20 21:45:12 +00:00
|
|
|
|
2016-08-26 19:56:41 +00:00
|
|
|
# Copy source to container for sake of build
|
|
|
|
COPY . "$BUILD_DIR"
|
|
|
|
|
|
|
|
# Build guacamole-server from local source
|
2018-02-09 00:29:07 +00:00
|
|
|
RUN ${PREFIX_DIR}/bin/build-guacd.sh "$BUILD_DIR" "$PREFIX_DIR"
|
|
|
|
|
|
|
|
# Record the packages of all runtime library dependencies
|
|
|
|
RUN ${PREFIX_DIR}/bin/list-dependencies.sh \
|
|
|
|
${PREFIX_DIR}/sbin/guacd \
|
|
|
|
${PREFIX_DIR}/lib/libguac-client-*.so \
|
2019-11-05 03:26:04 +00:00
|
|
|
${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
|
|
|
|
2018-04-02 04:24:50 +00:00
|
|
|
# Use same Debian as the base for the runtime image
|
2019-04-08 10:28:46 +00:00
|
|
|
FROM debian:${DEBIAN_VERSION}-slim
|
2017-12-06 12:57:12 +00:00
|
|
|
|
|
|
|
# Base directory for installed build artifacts.
|
|
|
|
# Due to limitations of the Docker image build process, this value is
|
|
|
|
# duplicated in an ARG in the first stage of the build. See also the
|
|
|
|
# CMD directive at the end of this build stage.
|
|
|
|
#
|
|
|
|
ARG PREFIX_DIR=/usr/local/guacamole
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
ARG RUNTIME_DEPENDENCIES=" \
|
2020-06-25 15:51:29 +00:00
|
|
|
netcat-openbsd \
|
2019-02-22 09:59:09 +00:00
|
|
|
ca-certificates \
|
2017-12-06 12:57:12 +00:00
|
|
|
ghostscript \
|
2018-02-08 20:40:15 +00:00
|
|
|
fonts-liberation \
|
|
|
|
fonts-dejavu \
|
|
|
|
xfonts-terminus"
|
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
|
2020-06-25 15:51:29 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends $RUNTIME_DEPENDENCIES && \
|
|
|
|
apt-get install -y --no-install-recommends $(cat "${PREFIX_DIR}"/DEPENDENCIES) && \
|
2018-02-09 00:29:07 +00:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2017-12-06 12:57:12 +00:00
|
|
|
# Link FreeRDP plugins into proper path
|
2018-02-09 00:29:07 +00:00
|
|
|
RUN ${PREFIX_DIR}/bin/link-freerdp-plugins.sh \
|
2019-11-05 03:26:04 +00:00
|
|
|
${PREFIX_DIR}/lib/freerdp2/libguac*.so
|
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
|
|
|
|
RUN useradd --system --create-home --shell /usr/sbin/nologin --uid $UID --no-user-group guacd
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
2018-03-29 08:32:06 +00:00
|
|
|
CMD /usr/local/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f
|
2016-05-20 21:45:12 +00:00
|
|
|
|