From df3527e3fd9b490a54778748cb2333f3d52abd61 Mon Sep 17 00:00:00 2001 From: Tiziano Puppi Date: Mon, 24 Nov 2025 11:10:24 +0100 Subject: [PATCH 1/5] Removed deprecated docker stack wait shell script in favor of native --detach flag --- action.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/action.yml b/action.yml index be584c7..41b7311 100644 --- a/action.yml +++ b/action.yml @@ -1,16 +1,16 @@ -name: 'Deploy' -description: 'Deploy an application using Docker Swarm' -author: 'Simplificator AG' +name: "Deploy" +description: "Deploy an application using Docker Swarm" +author: "Simplificator AG" # Add your action's branding here. This will appear on the GitHub Marketplace. branding: - icon: 'activity' - color: 'black' + icon: "activity" + color: "black" # Define your inputs here. inputs: compose-file: - description: 'Path to the docker-compose file' + description: "Path to the docker-compose file" required: true environment: @@ -26,11 +26,11 @@ inputs: required: false stack-name: - description: 'Name of the stack to deploy' + description: "Name of the stack to deploy" required: true ssh-user-at-host: - description: 'User@host to connect to' + description: "User@host to connect to" required: true ssh-port: @@ -77,21 +77,13 @@ runs: shell: bash if: "${{ inputs.secrets != '' }}" - - name: Pull docker-stack-wait image - run: docker pull sudobmitch/docker-stack-wait:v0.2.5 - shell: bash - - name: Deploying stack - run: docker stack deploy --compose-file ${{ inputs.compose-file }} --prune --with-registry-auth ${{ inputs.stack-name }} - shell: bash - - - name: Waiting for deployment to complete - run: docker run --rm -i -v $(pwd)/${{ inputs.compose-file }}:/docker-compose.yml -v /var/run/docker.sock:/var/run/docker.sock sudobmitch/docker-stack-wait:v0.2.5 -l "--since 2m" -t 120 ${{ inputs.stack-name }} + run: docker stack deploy --detach=false --compose-file ${{ inputs.compose-file }} --prune --with-registry-auth ${{ inputs.stack-name }} shell: bash - name: Cleaning up run: | - docker system prune -af --filter 'label!=org.opencontainers.image.source=git://github.com/sudo-bmitch/docker-stack-wait.git' --filter 'label!=org.opencontainers.image.version=v0.2.5' + docker system prune -af docker context remove --force target shell: bash From f860cf39268f93b9d6a28a0ddf459a360e5cf06b Mon Sep 17 00:00:00 2001 From: Tiziano Puppi Date: Mon, 24 Nov 2025 11:11:32 +0100 Subject: [PATCH 2/5] Update CHANGELOG for v1.0.1 release --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e28950c..3a6cf78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.1] - 2024-11-24 + +### Changed + +- Removed deprecated docker-stack-wait shell script +- Simplified Docker system prune command + ## [1.0.0] - 2024-05-13 Initial release. From 3656f2e8e827056ea7a7aaa5e6d4159269838b7d Mon Sep 17 00:00:00 2001 From: Tiziano Puppi Date: Mon, 24 Nov 2025 11:18:43 +0100 Subject: [PATCH 3/5] Fix tests --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eeb7de6..13c199a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,11 +67,6 @@ jobs: fi shell: bash - - name: Check that docker-stack-wait image is still there - run: | - ssh -p 2222 david@127.0.0.1 docker image inspect sudobmitch/docker-stack-wait:v0.2.5 - shell: bash - - name: Check that the Debian container got removed run: | if ssh -p 2222 david@127.0.0.1 docker container inspect debian; then From 53c2101aec789a78b08aac17424a62d064e2b96b Mon Sep 17 00:00:00 2001 From: Tiziano Puppi Date: Mon, 24 Nov 2025 11:23:17 +0100 Subject: [PATCH 4/5] Update CI workflow to pull Docker image instead of running a container for verification --- .github/workflows/ci.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13c199a..c2e85d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,9 +37,9 @@ jobs: mkdir -p ~/.ssh ssh-keyscan -t rsa -p 2222 127.0.0.1 >> ~/.ssh/known_hosts - - name: Run a container to verify that docker system prune will work + - name: Pull an image to verify that docker system prune will work run: | - ssh -p 2222 david@127.0.0.1 docker run --name debian debian:12 + ssh -p 2222 david@127.0.0.1 docker pull debian:12 shell: bash - name: Test @@ -67,14 +67,6 @@ jobs: fi shell: bash - - name: Check that the Debian container got removed - run: | - if ssh -p 2222 david@127.0.0.1 docker container inspect debian; then - echo "Debian container was not cleaned up!" - exit 1 - fi - shell: bash - - name: Check that the Debian image got removed run: | if ssh -p 2222 david@127.0.0.1 docker image inspect debian:12; then From 268117423f326651dcd355ca52ef306734c08b03 Mon Sep 17 00:00:00 2001 From: Tiziano Puppi Date: Mon, 24 Nov 2025 11:27:35 +0100 Subject: [PATCH 5/5] Switch to docker:dind base image to fix overlay filesystem issues in CI --- docker/server.Dockerfile | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/docker/server.Dockerfile b/docker/server.Dockerfile index b8f7e1d..5a9378f 100644 --- a/docker/server.Dockerfile +++ b/docker/server.Dockerfile @@ -1,20 +1,19 @@ -FROM geerlingguy/docker-debian12-ansible +FROM docker:dind -RUN apt update && \ - apt install -y ca-certificates curl gnupg openssh-server && \ - install -m 0755 -d /etc/apt/keyrings && \ - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ - chmod a+r /etc/apt/keyrings/docker.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ - apt update && \ - apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +# Install OpenSSH and other needed packages +RUN apk add --no-cache openssh sudo -RUN echo "PermitEmptyPasswords yes \n \ -PermitRootLogin yes \n \ -PasswordAuthentication yes" > /etc/ssh/sshd_config +# Configure SSH +RUN ssh-keygen -A && \ + echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config && \ + echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && \ + echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config -RUN adduser david && \ - usermod -aG docker david && \ - echo "david ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/david && \ - passwd -d david +# Create user david +RUN adduser -D david && \ + addgroup david docker && \ + echo "david ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/david && \ + passwd -d david + +# Start both dockerd and sshd +CMD dockerd-entrypoint.sh & /usr/sbin/sshd -D