diff --git a/.github/workflows/build-latest.yaml b/.github/workflows/build-latest.yaml new file mode 100644 index 0000000..77d9bfb --- /dev/null +++ b/.github/workflows/build-latest.yaml @@ -0,0 +1,30 @@ +name: build-latest + +on: + push: + # branches: + # - 'main' + paths-ignore: + - '**/README.md' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # - name: Login to Docker Hub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: false + tags: jwetzell/guacamole:latest + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64,linux/arm/v7 \ No newline at end of file diff --git a/Dockerfile.amd64 b/Dockerfile similarity index 86% rename from Dockerfile.amd64 rename to Dockerfile index 3e4c945..aa63242 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM tomcat:9.0.85-jre11 -ENV ARCH=amd64 \ - GUAC_VER=1.5.4 \ +ENV GUAC_VER=1.5.4 \ GUACAMOLE_HOME=/app/guacamole \ PG_VER=9.6.24 \ LIBSSH2_VER=1.11.0 \ @@ -9,8 +8,25 @@ ENV ARCH=amd64 \ POSTGRES_USER=guacamole \ POSTGRES_DB=guacamole_db + + +# Add user for postgres +RUN useradd postgres + +# Cleanup default tomcat stuff RUN rm -rf /usr/local/tomcat/webapps.dist +# Apply the s6-overlay +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=arm; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=aarch64; else ARCHITECTURE=amd64; fi \ + && curl -sS -L -O --output-dir /tmp/ --create-dirs "https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-${ARCHITECTURE}-installer" \ + && chmod +x /tmp/s6-overlay-${ARCHITECTURE}-installer && /tmp/s6-overlay-${ARCHITECTURE}-installer / \ + && rm -rf /tmp/s6-overlay-${ARCHITECTURE}-installer + +# make dirs for guacamole install +RUN mkdir -p ${GUACAMOLE_HOME} \ + ${GUACAMOLE_HOME}/lib \ + ${GUACAMOLE_HOME}/extensions + # Install dependencies RUN apt-get update \ && apt-get install -y curl ca-certificates gnupg \ @@ -22,8 +38,12 @@ RUN apt-get update \ ghostscript build-essential libreadline-dev \ && rm -rf /var/lib/apt/lists/* -# Build & install libssh2 +# Download libssh2 and postgresql source ADD https://www.libssh2.org/download/libssh2-${LIBSSH2_VER}.tar.gz /tmp +ADD https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz /tmp + + +# Build & install libssh2 RUN tar -xzvf /tmp/libssh2-${LIBSSH2_VER}.tar.gz \ && cd libssh2-${LIBSSH2_VER} \ && ./configure \ @@ -32,7 +52,6 @@ RUN tar -xzvf /tmp/libssh2-${LIBSSH2_VER}.tar.gz \ && rm -rf /tmp/libssh2-${LIBSSH2_VER}* # Build & install postgresql -ADD https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz /tmp RUN tar -xzvf /tmp/postgresql-${PG_VER}.tar.gz \ && cd postgresql-${PG_VER} \ && ./configure \ @@ -40,17 +59,6 @@ RUN tar -xzvf /tmp/postgresql-${PG_VER}.tar.gz \ && make install \ && rm -rf /tmp/postgresql-${PG_VER}* -RUN useradd postgres - -# Apply the s6-overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-amd64-installer /tmp/ -RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer / \ - && rm -rf /tmp/s6-overlay-amd64-installer - - -RUN mkdir -p ${GUACAMOLE_HOME} \ - ${GUACAMOLE_HOME}/lib \ - ${GUACAMOLE_HOME}/extensions WORKDIR ${GUACAMOLE_HOME} @@ -74,16 +82,13 @@ RUN curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/source/guac RUN mkdir ${GUACAMOLE_HOME}/extensions-available # Install guacamole-client and postgres auth adapter -RUN set -x \ +RUN set -xe \ && rm -rf ${CATALINA_HOME}/webapps/ROOT \ && curl -SLo ${CATALINA_HOME}/webapps/ROOT.war "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${GUAC_VER}.war" \ && curl -SLo ${GUACAMOLE_HOME}/lib/postgresql-42.1.4.jar "https://jdbc.postgresql.org/download/postgresql-42.2.24.jar" \ && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" \ && tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz \ && cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/mysql/guacamole-auth-jdbc-mysql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/sqlserver/guacamole-auth-jdbc-sqlserver-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ && cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/schema ${GUACAMOLE_HOME}/ \ && rm -rf guacamole-auth-jdbc-${GUAC_VER} guacamole-auth-jdbc-${GUAC_VER}.tar.gz @@ -97,7 +102,7 @@ RUN set -xe \ && cp guacamole-auth-sso-${GUAC_VER}/saml/guacamole-auth-sso-saml-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ && rm -rf guacamole-auth-sso-${GUAC_VER} guacamole-auth-sso-${GUAC_VER}.tar.gz -# add vault to available extensions folder structur differs from other extensions +# add vault to available extensions, folder structur differs from other extensions RUN set -xe \ && echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 deleted file mode 100644 index 058aa35..0000000 --- a/Dockerfile.arm64 +++ /dev/null @@ -1,124 +0,0 @@ -FROM tomcat:9.0.85-jre11 - -ENV GUAC_VER=1.5.4 \ - GUACAMOLE_HOME=/app/guacamole \ - PG_VER=9.6.24 \ - LIBSSH2_VER=1.11.0 \ - PGDATA=/config/postgres \ - POSTGRES_USER=guacamole \ - POSTGRES_DB=guacamole_db - -RUN rm -rf /usr/local/tomcat/webapps.dist - -# Install dependencies -RUN apt-get update \ - && apt-get install -y curl ca-certificates gnupg \ - libcairo2-dev libjpeg-turbo8-dev libpng-dev libavformat-dev \ - libossp-uuid-dev libavcodec-dev libavutil-dev \ - libswscale-dev freerdp2-dev libfreerdp-client2-2 libpango1.0-dev \ - libtelnet-dev libvncserver-dev \ - libpulse-dev libssl-dev libvorbis-dev libwebp-dev libwebsockets-dev \ - ghostscript build-essential libreadline-dev - -# Build & install libssh2 -ADD https://www.libssh2.org/download/libssh2-${LIBSSH2_VER}.tar.gz /tmp -RUN tar -xzvf /tmp/libssh2-${LIBSSH2_VER}.tar.gz \ - && cd libssh2-${LIBSSH2_VER} \ - && ./configure \ - && make \ - && make install \ - && rm -rf /tmp/libssh2-${LIBSSH2_VER}* - -# Build & install postgresql -ADD https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz /tmp -RUN tar -xzvf /tmp/postgresql-${PG_VER}.tar.gz \ - && cd postgresql-${PG_VER} \ - && ./configure \ - && make \ - && make install \ - && rm -rf /tmp/postgresql-${PG_VER}* - -RUN useradd postgres - -# Apply the s6-overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-armhf-installer /tmp/ -RUN chmod +x /tmp/s6-overlay-armhf-installer && /tmp/s6-overlay-armhf-installer / \ - && rm -rf /tmp/s6-overlay-armhf-installer - -RUN mkdir -p ${GUACAMOLE_HOME} \ - ${GUACAMOLE_HOME}/lib \ - ${GUACAMOLE_HOME}/extensions - -WORKDIR ${GUACAMOLE_HOME} - -# Link FreeRDP to where guac expects it to be -RUN ln -s /usr/local/lib/freerdp /usr/lib/arm-linux-gnueabihf/freerdp || exit 0 - -# Install guacamole-server - -RUN curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/source/guacamole-server-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-server-${GUAC_VER}.tar.gz \ - && cd guacamole-server-${GUAC_VER} \ - && export LDFLAGS="-lrt" \ - && ./configure --enable-allow-freerdp-snapshots \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - && cd .. \ - && rm -rf guacamole-server-${GUAC_VER}.tar.gz guacamole-server-${GUAC_VER} \ - && ldconfig - -# Create directory for extensions -RUN mkdir ${GUACAMOLE_HOME}/extensions-available - -# Install guacamole-client and postgres auth adapter -RUN set -x \ - && rm -rf ${CATALINA_HOME}/webapps/ROOT \ - && curl -SLo ${CATALINA_HOME}/webapps/ROOT.war "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${GUAC_VER}.war" \ - && curl -SLo ${GUACAMOLE_HOME}/lib/postgresql-42.1.4.jar "https://jdbc.postgresql.org/download/postgresql-42.2.24.jar" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz \ - && cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/mysql/guacamole-auth-jdbc-mysql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-jdbc-${GUAC_VER}/sqlserver/guacamole-auth-jdbc-sqlserver-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/schema ${GUACAMOLE_HOME}/ \ - && rm -rf guacamole-auth-jdbc-${GUAC_VER} guacamole-auth-jdbc-${GUAC_VER}.tar.gz - -# add auth-sso to available extensions folder structur differs from other extensions -RUN set -xe \ - && echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-sso-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-sso-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-auth-sso-${GUAC_VER}.tar.gz \ - && cp guacamole-auth-sso-${GUAC_VER}/cas/guacamole-auth-sso-cas-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-sso-${GUAC_VER}/openid/guacamole-auth-sso-openid-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-sso-${GUAC_VER}/saml/guacamole-auth-sso-saml-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-auth-sso-${GUAC_VER} guacamole-auth-sso-${GUAC_VER}.tar.gz - -# add vault to available extensions folder structur differs from other extensions -RUN set -xe \ - && echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-vault-${GUAC_VER}.tar.gz \ - && cp guacamole-vault-${GUAC_VER}/ksm/guacamole-vault-ksm-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-vault-${GUAC_VER} guacamole-vault-${GUAC_VER}.tar.gz - -# Add optional extensions -RUN set -xe \ - && for i in auth-duo auth-header auth-json auth-ldap auth-quickconnect auth-totp history-recording-storage; do \ - echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-${i}-${GUAC_VER}.tar.gz \ - && cp guacamole-${i}-${GUAC_VER}/guacamole-${i}-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-${i}-${GUAC_VER} guacamole-${i}-${GUAC_VER}.tar.gz \ - ;done - -ENV PATH="/usr/local/pgsql/bin:$PATH" -ENV GUACAMOLE_HOME=/config/guacamole - -WORKDIR /config - -COPY root / - -EXPOSE 8080 - -ENTRYPOINT [ "/init" ] diff --git a/Dockerfile.raspberry-pi b/Dockerfile.raspberry-pi deleted file mode 100644 index 40f199f..0000000 --- a/Dockerfile.raspberry-pi +++ /dev/null @@ -1,114 +0,0 @@ -FROM arm32v7/tomcat:9.0.85-jre11 - -ENV GUAC_VER=1.5.4 \ - GUACAMOLE_HOME=/app/guacamole \ - PG_VER=9.6.24 \ - LIBSSH2_VER=1.11.0 \ - PGDATA=/config/postgres \ - POSTGRES_USER=guacamole \ - POSTGRES_DB=guacamole_db - -RUN rm -rf /usr/local/tomcat/webapps.dist - -# Install base dependencies -RUN apt-get update \ - && apt-get install -y curl ca-certificates gnupg \ - libcairo2-dev libjpeg-turbo8-dev libpng-dev libavformat-dev \ - libossp-uuid-dev libavcodec-dev libavutil-dev \ - libswscale-dev freerdp2-dev libfreerdp-client2-2 libpango1.0-dev \ - libtelnet-dev libvncserver-dev \ - libpulse-dev libssl-dev libvorbis-dev libwebp-dev libwebsockets-dev \ - ghostscript build-essential libreadline-dev - -# Build & install libssh2 -ADD https://www.libssh2.org/download/libssh2-${LIBSSH2_VER}.tar.gz /tmp -RUN tar -xzvf /tmp/libssh2-${LIBSSH2_VER}.tar.gz \ - && cd libssh2-${LIBSSH2_VER} \ - && ./configure \ - && make \ - && make install \ - && rm -rf /tmp/libssh2-${LIBSSH2_VER}* - -# Build & install postgresql -ADD https://ftp.postgresql.org/pub/source/v${PG_VER}/postgresql-${PG_VER}.tar.gz /tmp -RUN tar -xzvf /tmp/postgresql-${PG_VER}.tar.gz \ - && cd postgresql-${PG_VER} \ - && ./configure \ - && make \ - && make install \ - && rm -rf /tmp/postgresql-${PG_VER}* - -RUN useradd postgres - -# Apply the s6-overlay -ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-armhf-installer /tmp/ -RUN chmod +x /tmp/s6-overlay-armhf-installer && /tmp/s6-overlay-armhf-installer / \ - && rm -rf /tmp/s6-overlay-armhf-installer - -RUN mkdir -p ${GUACAMOLE_HOME} \ - ${GUACAMOLE_HOME}/lib \ - ${GUACAMOLE_HOME}/extensions - -WORKDIR ${GUACAMOLE_HOME} - -# Link FreeRDP to where guac expects it to be -RUN ln -s /usr/local/lib/freerdp /usr/lib/arm-linux-gnueabihf/freerdp || exit 0 - -# Install guacamole-server -RUN curl -SLOk "https://archive.apache.org/dist/guacamole/${GUAC_VER}/source/guacamole-server-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-server-${GUAC_VER}.tar.gz \ - && cd guacamole-server-${GUAC_VER} \ - && ./configure --enable-allow-freerdp-snapshots \ - && make -j$(getconf _NPROCESSORS_ONLN) \ - && make install \ - && cd .. \ - && rm -rf guacamole-server-${GUAC_VER}.tar.gz guacamole-server-${GUAC_VER} \ - && ldconfig - -# Install guacamole-client and postgres auth adapter -RUN set -x \ - && rm -rf ${CATALINA_HOME}/webapps/ROOT \ - && curl -SLko ${CATALINA_HOME}/webapps/ROOT.war "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${GUAC_VER}.war" \ - && curl -SLko ${GUACAMOLE_HOME}/lib/postgresql-42.1.4.jar "https://jdbc.postgresql.org/download/postgresql-42.2.24.jar" \ - && curl -SLkO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-jdbc-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-auth-jdbc-${GUAC_VER}.tar.gz \ - && cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/guacamole-auth-jdbc-postgresql-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions/ \ - && cp -R guacamole-auth-jdbc-${GUAC_VER}/postgresql/schema ${GUACAMOLE_HOME}/ \ - && rm -rf guacamole-auth-jdbc-${GUAC_VER} guacamole-auth-jdbc-${GUAC_VER}.tar.gz - - # add auth-sso to available extensions folder structur differs from other extensions -RUN set -xe \ - && echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-sso-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-auth-sso-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-auth-sso-${GUAC_VER}.tar.gz \ - && cp guacamole-auth-sso-${GUAC_VER}/cas/guacamole-auth-sso-cas-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-sso-${GUAC_VER}/openid/guacamole-auth-sso-openid-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && cp guacamole-auth-sso-${GUAC_VER}/saml/guacamole-auth-sso-saml-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-auth-sso-${GUAC_VER} guacamole-auth-sso-${GUAC_VER}.tar.gz - -# add vault to available extensions folder structur differs from other extensions -RUN set -xe \ - && echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-vault-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-vault-${GUAC_VER}.tar.gz \ - && cp guacamole-vault-${GUAC_VER}/ksm/guacamole-vault-ksm-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-vault-${GUAC_VER} guacamole-vault-${GUAC_VER}.tar.gz - -# Add optional extensions -RUN set -xe \ - && for i in auth-duo auth-header auth-json auth-ldap auth-quickconnect auth-totp history-recording-storage; do \ - echo "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" \ - && curl -SLO "https://archive.apache.org/dist/guacamole/${GUAC_VER}/binary/guacamole-${i}-${GUAC_VER}.tar.gz" \ - && tar -xzf guacamole-${i}-${GUAC_VER}.tar.gz \ - && cp guacamole-${i}-${GUAC_VER}/guacamole-${i}-${GUAC_VER}.jar ${GUACAMOLE_HOME}/extensions-available/ \ - && rm -rf guacamole-${i}-${GUAC_VER} guacamole-${i}-${GUAC_VER}.tar.gz \ - ;done - -ENV PATH="/usr/local/pgsql/bin:$PATH" -ENV GUACAMOLE_HOME=/config/guacamole - -WORKDIR /config - -COPY root / - -ENTRYPOINT [ "/init" ]