From f183b8f044449101d2e6c06c7a4b7e74964117fe Mon Sep 17 00:00:00 2001 From: Michael Trip Date: Tue, 3 Oct 2023 21:06:54 +0200 Subject: [PATCH] fixing workflows and new build for aarch64 (testing) --- .../workflows/fedora-mate-build-aarch64.yml | 80 +++++++++++++++++++ .github/workflows/fedora-mate-build.yml | 3 + .github/workflows/fedora-xfce-build.yml | 3 + .github/workflows/ubuntu-mate-build.yml | 3 + mate/Dockerfile | 2 +- mate/Dockerfile.aarch64 | 55 +++++++++++++ 6 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/fedora-mate-build-aarch64.yml create mode 100644 mate/Dockerfile.aarch64 diff --git a/.github/workflows/fedora-mate-build-aarch64.yml b/.github/workflows/fedora-mate-build-aarch64.yml new file mode 100644 index 0000000..8fe8cca --- /dev/null +++ b/.github/workflows/fedora-mate-build-aarch64.yml @@ -0,0 +1,80 @@ +name: Fedora MATE build aarch64 + +# 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: '39 15 * * *' + push: + branches: [ "main" ] + paths: + - "mate/Dockerfile.aarch64" + - ".github/workflows/fedora-mate-build-aarch64.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-mate-aarch64 + + +jobs: + + + build_mate: + + 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: ./mate + file: ./mate/Dockerfile.aarch64 + platforms: linux/arm64 + 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 diff --git a/.github/workflows/fedora-mate-build.yml b/.github/workflows/fedora-mate-build.yml index 52e44ca..f7d9875 100644 --- a/.github/workflows/fedora-mate-build.yml +++ b/.github/workflows/fedora-mate-build.yml @@ -10,6 +10,9 @@ on: - cron: '39 15 * * *' push: branches: [ "main" ] + paths: + - "mate/Dockerfile" + - ".github/workflows/fedora-mate-build.yml" # Publish semver tags as releases. tags: [ 'v*.*.*' ] pull_request: diff --git a/.github/workflows/fedora-xfce-build.yml b/.github/workflows/fedora-xfce-build.yml index a0718fa..0751328 100644 --- a/.github/workflows/fedora-xfce-build.yml +++ b/.github/workflows/fedora-xfce-build.yml @@ -12,6 +12,9 @@ on: branches: [ "main" ] # Publish semver tags as releases. tags: [ 'v*.*.*' ] + paths: + - "xfce/Dockerfile" + - ".github/workflows/fedora-xfce-build.yml" pull_request: branches: [ "main" ] diff --git a/.github/workflows/ubuntu-mate-build.yml b/.github/workflows/ubuntu-mate-build.yml index b0a0b01..08b91a8 100644 --- a/.github/workflows/ubuntu-mate-build.yml +++ b/.github/workflows/ubuntu-mate-build.yml @@ -10,6 +10,9 @@ on: - cron: '39 15 * * *' push: branches: [ "main" ] + paths: + - "ubuntu-mate/Dockerfile" + - ".github/workflows/ubuntu-mate-build.yml" # Publish semver tags as releases. tags: [ 'v*.*.*' ] pull_request: diff --git a/mate/Dockerfile b/mate/Dockerfile index 17ddad0..2dfa27a 100644 --- a/mate/Dockerfile +++ b/mate/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/linuxserver/rdesktop:fedora-mate +FROM ghcr.io/linuxserver/rdesktop:fedora-mate # set version label ARG BUILD_DATE diff --git a/mate/Dockerfile.aarch64 b/mate/Dockerfile.aarch64 new file mode 100644 index 0000000..4898044 --- /dev/null +++ b/mate/Dockerfile.aarch64 @@ -0,0 +1,55 @@ +FROM ghcr.io/linuxserver/rdesktop:arm64v8-fedora-mate + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG TARGETARCH + +LABEL build_version="based on Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="Michael Trip" +WORKDIR /tmp + +RUN dnf install -y wget curl +RUN \ + case ${TARGETARCH} in \ + "amd64") DOWNLOAD_ARCH=x86_64 ;; \ + "arm64") DOWNLOAD_ARCH=aarch64 ;; \ + 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 + +RUN curl -L https://github.com/derailed/k9s/releases/download/v0.27.4/k9s_Linux_${TARGETARCH}.tar.gz --output /tmp/k9s.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 \ + terminator \ + tilix \ + kubernetes-client \ + libreoffice \ + pluma \ + neofetch \ + adwaita-gtk2-theme \ + adwaita-icon-theme \ + papirus-icon-theme \ + thunderbird \ + firefox \ + code && \ + dnf localinstall -y /tmp/openlens.rpm && \ + tar -zxvf /tmp/k9s.tar.gz && \ + mv /tmp/k9s /usr/local/bin && \ + echo "**** cleanup ****" && \ + dnf autoremove -y && \ + dnf clean all && \ + rm -rf \ + /config/.cache \ + /tmp/* + +# add local files +COPY /root / + +# ports and volumes +EXPOSE 3389 +VOLUME /home +VOLUME /config