Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/126#discussion_r162736330
  
    --- 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 --
    
    OK. Sounds like this really is the best we can do, then. It's unfortunate 
that multi-stage builds don't provide for isolating `COPY` to only the files 
affected by that build stage.


---

Reply via email to