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

    https://github.com/apache/guacamole-server/pull/126#discussion_r161844979
  
    --- 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 --
    
    > It's a little awkward to copy symlinks. But if you feel really strongly 
about it, there's certainly a way to get there.
    
    Nope, if there's a technical reason why this should be outside the build 
script, that's good enough for me.
    
    What's awkward about copying the links, out of curiosity?
    
    > I guess I was thinking that putting these links in place is really just 
an aspect of installing the build artifacts into the runtime image.
    
    In my view, the creation of the symlinks is analogous to other parts of the 
install process which are performed by `make install`, and so shouldn't be part 
of the scope of tasks performed outside the build/install script, however if 
there are technical reasons that this is best kept within the `Dockerfile`, 
then it is what it is.


---

Reply via email to