From 3ef7e51161543f5fbd1147fb0bf7a40c68721198 Mon Sep 17 00:00:00 2001 From: incognitotgt Date: Sun, 4 Aug 2024 22:14:30 -0400 Subject: [PATCH] organize repo, make gh action trigger less \n\n !build-containers --- .github/workflows/docker-image.yml | 33 ++++++++++++++---------------- README.md | 4 ++-- chromium/Dockerfile | 17 ++++++++------- debian-kde/Dockerfile | 18 ++++++++-------- debian/Dockerfile | 14 ++++++------- firefox/Dockerfile | 17 ++++++++------- gimp/Dockerfile | 17 ++++++++------- pinball/Dockerfile | 9 ++++---- build.sh => scripts/build.sh | 13 ------------ buildx.sh => scripts/buildx.sh | 0 start.sh => scripts/start.sh | 0 11 files changed, 61 insertions(+), 81 deletions(-) rename build.sh => scripts/build.sh (78%) rename buildx.sh => scripts/buildx.sh (100%) rename start.sh => scripts/start.sh (100%) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9eb1d70..30b57ec 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,30 +2,27 @@ name: Docker Image CI on: push: - branches: [ "main" ] + branches: ["main"] jobs: - docker: - + if: "!contains(github.event.head_commit.message, '!build-containers')" runs-on: ubuntu-latest permissions: contents: read packages: write steps: - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build the Docker image - run: bash buildx.sh + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build the Docker image + run: bash scripts/buildx.sh diff --git a/README.md b/README.md index 0c3dd08..c7b4378 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stardust Images -Docker workspaces with TigerVNC preinstalled, created specifically for Stardust. However, these images can also be used independently. +Docker workspaces with Guac preinstalled, created specifically for Stardust. However, these images can also be used independently. Additionally, a Fastify server is included for file upload and download functionality. @@ -12,4 +12,4 @@ To run the Docker image, use the following command (using Debian as an example): docker run -it --rm -p 5901:5901 -p 6080:6080 ghcr.io/spaceness/debian:latest ``` -This command will start the Docker container and open the required ports for TigerVNC and the agent. +This command will start the Docker container and open the required ports for Guac and the agent. diff --git a/chromium/Dockerfile b/chromium/Dockerfile index f73a2ed..d0dcc9a 100644 --- a/chromium/Dockerfile +++ b/chromium/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app RUN apt-get update && apt-get install --no-install-recommends -y \ xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev \ python3 python3-pip xterm procps python3-numpy xfwm4 xfce4-terminal xfce4-session xfconf xfce4-notifyd \ - wget curl inetutils-ping imagemagick nano tigervnc-tools tigervnc-standalone-server tigervnc-common \ + wget curl inetutils-ping imagemagickvimtigervnc-tools tigervnc-standalone-server tigervnc-common \ chromium && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ @@ -25,13 +25,12 @@ USER stardust RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server -COPY ./start.sh ./start.sh -COPY ./chromium/xstartup ./xstartup - -RUN cp ./xstartup /home/stardust/.vnc/xstartup && \ - chmod +x /home/stardust/.vnc/xstartup && \ - cd server && sudo npm i -g pnpm tsx && sudo pnpm i && sudo pnpm build - +RUN cd server && \ + sudo npm i -g pnpm tsx && \ + sudo pnpm i && \ + sudo pnpm build +COPY ./scripts/start.sh ./start.sh +COPY ./chromium/xstartup /home/stardust/.vnc/xstartup +RUN sudo chmod +x /home/stardust/.vnc/xstartup CMD ["bash", "start.sh"] - EXPOSE 5901 6080 diff --git a/debian-kde/Dockerfile b/debian-kde/Dockerfile index 4cd6039..fe3f916 100644 --- a/debian-kde/Dockerfile +++ b/debian-kde/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app RUN apt-get update && apt-get install -y \ xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev \ - python3 python3-pip xterm procps python3-numpy wget curl inetutils-ping imagemagick nano \ + python3 python3-pip xterm procps python3-numpy wget curl inetutils-ping imagemagickvim\ kde-plasma-desktop breeze firefox-esr kwin-x11 plasma-discover tigervnc-tools tigervnc-standalone-server \ tigervnc-common && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ @@ -26,13 +26,13 @@ USER stardust RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server -COPY ./start.sh ./start.sh -COPY ./debian-kde/xstartup ./xstartup - -RUN cp ./xstartup /home/stardust/.vnc/xstartup && \ - chmod +x /home/stardust/.vnc/xstartup && \ - cd server && sudo npm i -g pnpm tsx && sudo pnpm i && sudo pnpm build - +RUN cd server && \ + sudo npm i -g pnpm tsx && \ + sudo pnpm i && \ + sudo pnpm build +COPY ./scripts/start.sh ./start.sh +COPY ./debian-kde/xstartup /home/stardust/.vnc/xstartup +RUN sudo chmod +x /home/stardust/.vnc/xstartup +RUN touch /home/stardust/.Xauthority CMD ["bash", "start.sh"] - EXPOSE 5901 6080 diff --git a/debian/Dockerfile b/debian/Dockerfile index 003895c..862eff7 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile @@ -3,7 +3,9 @@ LABEL org.opencontainers.image.source https://github.com/spaceness/stardust-imag ENV USER=stardust ENV PNPM_HOME="/home/stardust/.local/share/pnpm" WORKDIR /app -RUN apt-get update && apt-get install --no-install-recommends -y xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev python3 python3-pip xterm git procps python3-numpy neofetch xfce4 wget curl xfce4-goodies inetutils-ping firefox-esr chromium gimp imagemagick remmina remmina-plugin-vnc flatpak nano +RUN apt-get update && apt-get install --no-install-recommends -y xfonts-75dpi xvfb passwd sudo dbus dbus-x11 \ + libxrandr2 libxext-dev libxrender-dev libxtst-dev python3 python3-pip xterm git procps python3-numpy neofetch \ + xfce4 wget curl xfce4-goodies inetutils-ping firefox-esr chromium gimp imagemagick remmina remmina-plugin-vnc remmina-plugin-rdp flatpak vim RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\ apt-get install -y nodejs RUN apt-get install --no-install-recommends -y \ @@ -18,16 +20,14 @@ RUN echo "stardust ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers RUN usermod -aG sudo stardust USER stardust RUN mkdir -p /home/stardust/.vnc -RUN touch /home/stardust/.Xresources +RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server RUN cd server && \ sudo npm i -g pnpm tsx && \ sudo pnpm i && \ sudo pnpm build -COPY ./start.sh ./start.sh -COPY ./debian/xstartup ./xstartup -RUN cp ./xstartup /home/stardust/.vnc/xstartup -RUN chmod +x /home/stardust/.vnc/xstartup -RUN touch /home/stardust/.Xauthority +COPY ./scripts/start.sh ./start.sh +COPY ./debian/xstartup /home/stardust/.vnc/xstartup +RUN sudo chmod +x /home/stardust/.vnc/xstartup CMD ["bash", "start.sh"] EXPOSE 5901 6080 diff --git a/firefox/Dockerfile b/firefox/Dockerfile index 15be3fe..788c83d 100644 --- a/firefox/Dockerfile +++ b/firefox/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app RUN apt-get update && apt-get install --no-install-recommends -y \ xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev \ python3 python3-pip xterm procps python3-numpy xfwm4 xfce4-terminal xfce4-session xfconf xfce4-notifyd \ - wget curl inetutils-ping imagemagick nano tigervnc-tools tigervnc-standalone-server tigervnc-common \ + wget curl inetutils-ping imagemagickvimtigervnc-tools tigervnc-standalone-server tigervnc-common \ firefox-esr && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ @@ -25,13 +25,12 @@ USER stardust RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server -COPY ./start.sh ./start.sh -COPY ./firefox/xstartup ./xstartup - -RUN cp ./xstartup /home/stardust/.vnc/xstartup && \ - chmod +x /home/stardust/.vnc/xstartup && \ - cd server && sudo npm i -g pnpm tsx && sudo pnpm i && sudo pnpm build - +RUN cd server && \ + sudo npm i -g pnpm tsx && \ + sudo pnpm i && \ + sudo pnpm build +COPY ./scripts/start.sh ./start.sh +COPY ./firefox/xstartup /home/stardust/.vnc/xstartup +RUN sudo chmod +x /home/stardust/.vnc/xstartup CMD ["bash", "start.sh"] - EXPOSE 5901 6080 diff --git a/gimp/Dockerfile b/gimp/Dockerfile index 8cba670..71449c8 100644 --- a/gimp/Dockerfile +++ b/gimp/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app RUN apt-get update && apt-get install --no-install-recommends -y \ xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev \ python3 python3-pip xterm procps python3-numpy xfwm4 xfce4-terminal xfce4-session xfconf xfce4-notifyd \ - wget curl inetutils-ping imagemagick nano tigervnc-tools tigervnc-standalone-server tigervnc-common gimp && \ + wget curl inetutils-ping imagemagickvimtigervnc-tools tigervnc-standalone-server tigervnc-common gimp && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ apt-get clean && rm -rf /var/lib/apt/lists/* @@ -24,13 +24,12 @@ USER stardust RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server -COPY ./start.sh ./start.sh -COPY ./gimp/xstartup ./xstartup - -RUN cp ./xstartup /home/stardust/.vnc/xstartup && \ - chmod +x /home/stardust/.vnc/xstartup && \ - cd server && sudo npm i -g pnpm tsx && sudo pnpm i && sudo pnpm build - +RUN cd server && \ + sudo npm i -g pnpm tsx && \ + sudo pnpm i && \ + sudo pnpm build +COPY ./scripts/start.sh ./start.sh +COPY ./gimp/xstartup /home/stardust/.vnc/xstartup +RUN sudo chmod +x /home/stardust/.vnc/xstartup CMD ["bash", "start.sh"] - EXPOSE 5901 6080 diff --git a/pinball/Dockerfile b/pinball/Dockerfile index 19d0f92..b71ac35 100644 --- a/pinball/Dockerfile +++ b/pinball/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /app RUN apt-get update && apt-get install --no-install-recommends -y \ xfonts-75dpi xvfb passwd sudo dbus dbus-x11 libxrandr2 libxext-dev libxrender-dev libxtst-dev \ python3 python3-pip xterm procps python3-numpy unzip xfwm4 xfce4-terminal xfce4-session xfconf xfce4-notifyd \ - wget curl inetutils-ping imagemagick nano libsdl2-mixer-2.0-0 libsdl2-2.0-0 fluidsynth tigervnc-tools \ + wget curl inetutils-ping imagemagickvimlibsdl2-mixer-2.0-0 libsdl2-2.0-0 fluidsynth tigervnc-tools \ tigervnc-standalone-server tigervnc-common && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ @@ -25,11 +25,10 @@ USER stardust RUN touch /home/stardust/.Xresources /home/stardust/.Xauthority COPY ./server ./server -COPY ./start.sh ./start.sh -COPY ./pinball/xstartup ./xstartup +COPY ./scripts/start.sh ./start.sh +COPY ./pinball/xstartup /home/stardust/.vnc/xstartup -RUN cp ./xstartup /home/stardust/.vnc/xstartup && \ - chmod +x /home/stardust/.vnc/xstartup && \ +RUN sudo chmod +x /home/stardust/.vnc/xstartup && \ cd server && sudo npm i -g pnpm tsx && sudo pnpm i && sudo pnpm build USER root diff --git a/build.sh b/scripts/build.sh similarity index 78% rename from build.sh rename to scripts/build.sh index d907bcc..5e9b72d 100644 --- a/build.sh +++ b/scripts/build.sh @@ -39,22 +39,9 @@ else fi -push_flag=false -for arg in "$@"; do - if [ "$arg" == "-p" ]; then - push_flag=true - break - fi -done for t in ${images[@]}; do printf "$BANNER$BGREEN Building$OFF $BLUE$t$OFF\n" docker build -t ghcr.io/spaceness/$t -f $t/Dockerfile .; - if $push_flag; then - printf "$BANNER$BBLUE Pushing$OFF Docker container$BLUE ghcr.io/spaceness/$t$OFF\n" - docker push ghcr.io/spaceness/$t -else - printf "\n$BANNER$BRED Skipping$OFF push for$BLUE ghcr.io/spaceness/$t$OFF\n\n" -fi done diff --git a/buildx.sh b/scripts/buildx.sh similarity index 100% rename from buildx.sh rename to scripts/buildx.sh diff --git a/start.sh b/scripts/start.sh similarity index 100% rename from start.sh rename to scripts/start.sh