Github user ceharris commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/126#discussion_r162611549
  
    --- Diff: Dockerfile ---
    @@ -76,13 +68,63 @@ COPY src/guacd-docker/bin /opt/guacd/bin/
     COPY . "$BUILD_DIR"
     
     # Build guacamole-server from local source
    -RUN yum -y install $BUILD_DEPENDENCIES         && \
    -    /opt/guacd/bin/build-guacd.sh "$BUILD_DIR" && \
    -    rm -Rf "$BUILD_DIR"                        && \
    -    yum -y autoremove $BUILD_DEPENDENCIES      && \
    -    yum clean all
    +RUN /opt/guacd/bin/build-guacd.sh "$BUILD_DIR" "$PREFIX_DIR"
     
    -# Start guacd, listening on port 0.0.0.0:4822
    +# Use same CentOS as the base for the runtime image
    +FROM centos:${CENTOS_VERSION}
    +
    +# 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
    +ENV LC_ALL=en_US.UTF-8
    +
    +ARG RUNTIME_DEPENDENCIES="            \
    +        cairo                         \
    +        dejavu-sans-mono-fonts        \
    +        freerdp                       \
    +        freerdp-plugins               \
    +        ghostscript                   \
    +        libjpeg-turbo                 \
    +        libssh2                       \
    +        liberation-mono-fonts         \
    +        libtelnet                     \
    +        libvorbis                     \
    +        libvncserver                  \
    +        libwebp                       \
    +        pango                         \
    +        pulseaudio-libs               \
    +        terminus-fonts                \
    +        uuid"
    +
    +# Bring runtime environment up to date and install runtime dependencies
    +RUN yum -y update                          && \
    +    yum -y install epel-release            && \
    +    yum -y install $RUNTIME_DEPENDENCIES   && \
    +    yum clean all                          && \
    +    rm -rf /var/cache/yum
    +
    +# Copy build artifacts into this stage
    +COPY --from=builder ${PREFIX_DIR} ${PREFIX_DIR}
    +
    +# Link FreeRDP plugins into proper path
    +RUN FREERDP_DIR=$(dirname \
    +        $(rpm -ql freerdp-libs | grep 'libfreerdp.*\.so' | head -n1)) && \
    +    FREERDP_PLUGIN_DIR="${FREERDP_DIR}/freerdp" && \
    +    mkdir -p "$FREERDP_PLUGIN_DIR" && \
    +    ln -s "$PREFIX_DIR"/lib/freerdp/*.so "$FREERDP_PLUGIN_DIR"
    +
    --- End diff --
    
    Copying symlinks is awkward because copying from the build image to the 
runtime image is being performed by the Dockerfile COPY directive. If you 
specify the full path for the symlink, it copies the link target into 
destination directory rather than copying the link. It will copy symlinks if 
you specify the directory containing the links (e.g. in this case 
'/lib64/freerdp) but that copies everything in the directory in addition to the 
links that would be placed there by Guacamole.


---

Reply via email to