ARG BASE_REGISTRY=registry1.dsop.io ARG BASE_IMAGE=ironbank/redhat/ubi/ubi8 ARG BASE_TAG=8.4 FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as builder USER 0 ARG PREFIX_DIR=/usr/local/guacamole ARG BUILD_DIR=/tmp/guacd-docker-BUILD ARG PACKAGES="nc autoconf automake make wget gcc dnf-plugins-core libtool libwebp-devel openssl-devel libuuid-devel libpng-devel libjpeg-turbo-devel libvorbis" COPY guacamole-server-1.3.0.tar.gz / COPY *.rpm /opt/pkgs/ COPY signatures/* /opt/signatures/ COPY scripts/ ${PREFIX_DIR}/bin/ RUN dnf upgrade -y && \ rpm --import /opt/signatures/* && \ dnf install -y --nodocs $PACKAGES && \ dnf localinstall -y /opt/pkgs/*.rpm && \ tar -xzvf guacamole-server-1.3.0.tar.gz && \ cp -r guacamole-server-1.3.0/ "$BUILD_DIR" # Build guacamole-server from local source RUN cd "$BUILD_DIR" && \ autoreconf -fi && \ ./configure --prefix="$PREFIX_DIR" --disable-guaclog --with-freerdp-plugin-dir="$PREFIX_DIR/lib/freerdp2" && \ make && \ make install && \ ldconfig FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as base # Arguments must be respecified due to being out of scope ARG PREFIX_DIR=/usr/local/guacamole # Runtime environment ENV LC_ALL=C.UTF-8 ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib ENV GUACD_LOG_LEVEL=info # Copy build artifacts into this stage COPY --from=builder ${PREFIX_DIR}/ ${PREFIX_DIR}/ COPY --from=builder /opt/signatures/ /opt/signatures/ COPY freerdp-libs.rpm lame-libs.rpm libev.rpm libssh2.rpm libvncserver.rpm libwebsockets.rpm libwinpr.rpm \ libxkbfile.rpm lzo-minilzo.rpm ghostscript-tools-fonts.rpm liberation-fonts-common.rpm terminus-fonts.rpm /opt/pkgs/ RUN dnf update -y && \ rpm --import /opt/signatures/* && \ dnf install -y --nodocs nmap dejavu-sans-fonts libwebp cairo uuid pango && \ dnf localinstall -y /opt/pkgs/*.rpm && \ rm -rf /opt/pkgs && \ rm -rf /opt/signatures && \ rm -rf /var/lib/apt/lists/* && \ dnf clean all && \ rm -rf /var/cache/dnf # Link FreeRDP plugins into proper path RUN chmod +x ${PREFIX_DIR}/bin/link-freerdp-plugins.sh && \ ${PREFIX_DIR}/bin/link-freerdp-plugins.sh ${PREFIX_DIR}/lib/freerdp2/libguac*.so RUN groupadd --gid 1000 guacd && \ useradd --system --create-home --shell /usr/sbin/nologin --uid 1000 --gid 1000 guacd USER guacd EXPOSE 4822 HEALTHCHECK --interval=5m --timeout=5s CMD nc -z 127.0.0.1 4822 || exit 1 CMD /usr/local/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f