diff --git a/.github/workflows/ubuntu-xfce-build.yml b/.github/workflows/ubuntu-xfce-build.yml new file mode 100644 index 0000000..17ba935 --- /dev/null +++ b/.github/workflows/ubuntu-xfce-build.yml @@ -0,0 +1,88 @@ +name: Ubuntu MATE build + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '0 3 * * *' + push: + branches: [ "main" ] + paths: + - "ubuntu-xfce/Dockerfile" + - ".github/workflows/ubuntu-xfce-build.yml" + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "main" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }}/containerdesk-ubuntu-xfce + + +jobs: + + build_xfce: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + with: + context: ./ubuntu-mate + file: ./ubuntu-mate/Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + keepalive-job: + name: Keepalive Workflow + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - uses: actions/checkout@v4 + - uses: gautamkrishnar/keepalive-workflow@v2 diff --git a/mate/Dockerfile b/mate/Dockerfile index 0881b88..82766d5 100644 --- a/mate/Dockerfile +++ b/mate/Dockerfile @@ -4,8 +4,8 @@ FROM ghcr.io/linuxserver/rdesktop:fedora-mate ARG BUILD_DATE ARG VERSION ARG TARGETARCH -ARG SEABIRD_VERSION=0.5.1 -ARG K9S_VERSION=0.32.5 +ARG SEABIRD_VERSION=0.6.0 +ARG K9S_VERSION=0.50.9 LABEL build_version="based on Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="Michael Trip" WORKDIR /tmp @@ -13,18 +13,22 @@ WORKDIR /tmp RUN dnf install -y wget curl RUN \ case ${TARGETARCH} in \ - "amd64") DOWNLOAD_ARCH=x86_64 ;; \ - "arm64") DOWNLOAD_ARCH=aarch64 ;; \ + "amd64") DOWNLOAD_ARCH=linux-amd64 ;; \ + "arm64") DOWNLOAD_ARCH=linux-arm64 ;; \ esac \ - && curl -L https://github.com/MuhammedKalkan/OpenLens/releases/download/v6.5.2-366/OpenLens-6.5.2-366.${DOWNLOAD_ARCH}.rpm --output /tmp/openlens.rpm + && curl -L https://github.com/freelensapp/freelens/releases/download/v1.5.3/Freelens-1.5.3-${DOWNLOAD_ARCH}.rpm --output /tmp/freelens.rpm RUN curl -L https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_${TARGETARCH}.tar.gz --output /tmp/k9s.tar.gz RUN curl -L https://github.com/getseabird/seabird/releases/download/v${SEABIRD_VERSION}/seabird_linux_${TARGETARCH}.tar.gz --output /tmp/seabird.tar.gz -RUN \ - echo "**** install packages ****" && \ - rpm --import https://packages.microsoft.com/keys/microsoft.asc && \ - echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo && \ - dnf install -y --setopt=install_weak_deps=False --best \ + +RUN echo "**** import Microsoft GPG key ****" \ + && rpm --import https://packages.microsoft.com/keys/microsoft.asc + +RUN echo "**** add VS Code repo ****" \ + && echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo + +RUN echo "**** install packages ****" \ + && dnf install -y --setopt=install_weak_deps=False --best \ terminator \ tilix \ caja \ @@ -45,18 +49,25 @@ RUN \ vte291-gtk4 \ thunderbird \ firefox \ - code && \ - dnf localinstall -y /tmp/openlens.rpm && \ - tar -zxvf /tmp/k9s.tar.gz && \ - tar -zxvf /tmp/seabird.tar.gz && \ - mv /tmp/k9s /usr/local/bin && \ - mv /tmp/seabird /usr/local/bin && \ - echo "**** cleanup ****" && \ - dnf autoremove -y && \ - dnf clean all && \ - rm -rf \ - /config/.cache \ - /tmp/* + code + +RUN echo "**** install freelens ****" \ + && dnf localinstall -y /tmp/freelens.rpm + +RUN echo "**** extract k9s ****" \ + && tar -zxvf /tmp/k9s.tar.gz + +RUN echo "**** extract seabird ****" \ + && tar -zxvf /tmp/seabird.tar.gz + +RUN echo "**** move k9s and seabird to /usr/local/bin ****" \ + && mv /tmp/k9s /usr/local/bin \ + && mv /tmp/seabird /usr/local/bin + +RUN echo "**** cleanup ****" \ + && dnf autoremove -y \ + && dnf clean all \ + && rm -rf /config/.cache /tmp/* # add local files COPY /root / diff --git a/ubuntu-mate/Dockerfile b/ubuntu-mate/Dockerfile index 80c4d97..678ed32 100644 --- a/ubuntu-mate/Dockerfile +++ b/ubuntu-mate/Dockerfile @@ -5,15 +5,23 @@ ARG BUILD_DATE ARG TARGETARCH ARG VERSION ARG KUBECTL_VERSION=1.30.2 -ARG SEABIRD_VERSION=0.5.1 -ARG K9S_VERSION=0.32.5 +ARG HELM_VERSION=3.15.2 +ARG SEABIRD_VERSION=0.6.0 +ARG K9S_VERSION=0.50.9 +ARG FREELENS_VERSION=1.5.3 LABEL build_version="based on Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="Michael Trip" WORKDIR /tmp RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y curl wget -RUN curl -L https://github.com/MuhammedKalkan/OpenLens/releases/download/v6.5.2-366/OpenLens-6.5.2-366.${TARGETARCH}.deb --output /tmp/openlens.deb +RUN \ + case ${TARGETARCH} in \ + "amd64") DOWNLOAD_ARCH=linux-amd64 ;; \ + "arm64") DOWNLOAD_ARCH=linux-arm64 ;; \ + esac \ + && curl -L https://github.com/freelensapp/freelens/releases/download/v${FREELENS_VERSION}/Freelens-${FREELENS_VERSION}-${DOWNLOAD_ARCH}.deb --output /tmp/freelens.deb RUN curl -L https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_${TARGETARCH}.tar.gz --output /tmp/k9s.tar.gz -RUN curl -l https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl --output /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl +RUN curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl --output /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl +RUN curl -L https://get.helm.sh/helm-v${HELM_VERSION}-linux-${TARGETARCH}.tar.gz --output /tmp/helm.tar.gz RUN curl -L https://github.com/getseabird/seabird/releases/download/v${SEABIRD_VERSION}/seabird_linux_${TARGETARCH}.tar.gz --output /tmp/seabird.tar.gz @@ -37,10 +45,13 @@ RUN \ tilix \ terminator \ code \ + mate-themes \ xdg-utils && \ - dpkg -i /tmp/openlens.deb && \ + apt-get install -y /tmp/freelens.deb && \ tar -zxvf /tmp/k9s.tar.gz && \ tar -zxvf /tmp/seabird.tar.gz && \ + tar -zxvf /tmp/helm.tar.gz && \ + mv linux-${TARGETARCH}/helm /usr/local/bin/helm && \ mv /tmp/k9s /usr/local/bin && \ mv /tmp/seabird /usr/local/bin && \ echo "**** cleanup ****" && \ @@ -50,7 +61,6 @@ RUN \ /var/tmp/* \ /tmp/* -# add local files COPY /root / # ports and volumes diff --git a/ubuntu-xfce/Dockerfile b/ubuntu-xfce/Dockerfile new file mode 100644 index 0000000..8873453 --- /dev/null +++ b/ubuntu-xfce/Dockerfile @@ -0,0 +1,64 @@ +FROM ghcr.io/linuxserver/rdesktop:ubuntu-xfce +# set version label +ARG BUILD_DATE +# ARG BUILDARCH +ARG TARGETARCH +ARG VERSION +ARG KUBECTL_VERSION=1.30.2 +ARG HELM_VERSION=3.15.2 +ARG SEABIRD_VERSION=0.6.0 +ARG K9S_VERSION=0.50.9 +ARG FREELENS_VERSION=1.5.3 +LABEL build_version="based on Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="Michael Trip" +WORKDIR /tmp +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y curl wget +RUN \ + case ${TARGETARCH} in \ + "amd64") DOWNLOAD_ARCH=linux-amd64 ;; \ + "arm64") DOWNLOAD_ARCH=linux-arm64 ;; \ + esac \ + && curl -L https://github.com/freelensapp/freelens/releases/download/v${FREELENS_VERSION}/Freelens-${FREELENS_VERSION}-${DOWNLOAD_ARCH}.deb --output /tmp/freelens.deb +RUN curl -L https://github.com/derailed/k9s/releases/download/v${K9S_VERSION}/k9s_Linux_${TARGETARCH}.tar.gz --output /tmp/k9s.tar.gz +RUN curl -L https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl --output /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl +RUN curl -L https://get.helm.sh/helm-v${HELM_VERSION}-linux-${TARGETARCH}.tar.gz --output /tmp/helm.tar.gz +RUN curl -L https://github.com/getseabird/seabird/releases/download/v${SEABIRD_VERSION}/seabird_linux_${TARGETARCH}.tar.gz --output /tmp/seabird.tar.gz + + +RUN echo "**** install packages ****" +RUN apt update +RUN DEBIAN_FRONTEND=noninteractive apt-get install wget -y +RUN echo "**** Installing vscode stuff ***" +RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg +RUN cp packages.microsoft.gpg /etc/apt/keyrings +RUN echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list +RUN DEBIAN_FRONTEND=noninteractive apt-get install apt-transport-https -y +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + vim \ + neofetch \ + libreoffice \ + thunderbird \ + pluma \ + tilix \ + terminator \ + code \ +# xfce4-themes + xdg-utils +RUN apt-get install -y /tmp/freelens.deb +RUN tar -zxvf /tmp/k9s.tar.gz +RUN tar -zxvf /tmp/seabird.tar.gz +RUN tar -zxvf /tmp/helm.tar.gz +RUN mv linux-${TARGETARCH}/helm /usr/local/bin/helm +RUN mv /tmp/k9s /usr/local/bin +RUN mv /tmp/seabird /usr/local/bin +RUN echo "**** cleanup ****" +RUN apt-get autoclean +RUN rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* + +COPY /root / + +# ports and volumes +EXPOSE 3389 +VOLUME /home +VOLUME /config diff --git a/ubuntu-xfce/root/etc/cont-init.d/60-create-user b/ubuntu-xfce/root/etc/cont-init.d/60-create-user new file mode 100755 index 0000000..89b2aff --- /dev/null +++ b/ubuntu-xfce/root/etc/cont-init.d/60-create-user @@ -0,0 +1,37 @@ +#!/usr/bin/with-contenv bash + + +echo "**** create ${USERNAME} user and make our folders ****" && \ +useradd -u 912 -U -d /home/${USERNAME} -s /bin/bash ${USERNAME} +usermod -G users,sudo ${USERNAME} +echo "${USERNAME}:${PASSWORD}" | chpasswd +mkdir -p /home/${USERNAME} +chown -R ${USERNAME}:${USERNAME} /home/${USERNAME} + +chmod 755 /etc +chmod 755 /etc/xrdp +chmod 755 /etc/xrdp/sesman.ini + +touch /home/${USERNAME}/lock.file + +# create .config dir +[[ ! -d /home/${USERNAME}/.config ]] && \ + mkdir -p /home/${USERNAME}/.config + + +cp /defaults/startwm.sh /home/${USERNAME}/startwm.sh +chmod +x /home/${USERNAME}/startwm.sh +chown -R ${USERNAME}:${USERAME} /home/${USERNAME} + +# permissions +PERM=$(stat -c '%U' /home/${USERNAME}/.config) +[[ "${PERM}" != "${USERNAME}" ]] && \ + chown -R ${USERNAME}:${USERNAME} /home/${USERNAME} + + +# set random password for abc user to prevent it from connecting + +RANDOM_PASS=`tr -dc A-Za-z0-9