You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by ceharris <gi...@git.apache.org> on 2018/01/16 17:00:54 UTC

[GitHub] guacamole-server pull request #126: GUACAMOLE-456: use Docker multi-stage bu...

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

    https://github.com/apache/guacamole-server/pull/126#discussion_r161821557
  
    --- 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.
    
    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.


---