From a4c567339809017bd0a57000ce634b494ae8857b Mon Sep 17 00:00:00 2001 From: David Binney Date: Thu, 20 Jun 2024 10:59:15 +0930 Subject: [PATCH] Release/more build testing (#16) testing new releases changes shriking the container image --- .github/workflows/docker-build-push.yml | 17 ++++++++++++++-- Dockerfile | 26 ++++++++++++------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 6eb268f..c06c026 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -3,6 +3,8 @@ on: push: tags: - "v*" + branches: + - "release/*" jobs: cache: @@ -14,8 +16,7 @@ jobs: - name: Cache Docker layers uses: actions/cache@v2 with: - path: | - /tmp/.buildx-cache + path: /tmp/.buildx-cache key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }} docker: @@ -57,9 +58,21 @@ jobs: ghcr.io/donkeyx/cluster-utils docker.io/donkeyx/cluster-utils tags: | + type=sha + type=ref,event=branch type=semver,pattern={{version}} type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} + branches: | + release/* + + - name: Debug Metadata Outputs + run: | + echo "Tags: ${{ steps.meta.outputs.tags }}" + echo "Labels: ${{ steps.meta.outputs.labels }}" + echo "Images: ${{ steps.meta.outputs.images }}" + echo "Meta Outputs: ${{ toJson(steps.meta.outputs) }}" + - name: Build and push uses: docker/build-push-action@v5 diff --git a/Dockerfile b/Dockerfile index dfe28d0..0f6a84f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ -# Description: This is a utility container with all the tools needed for testing clusters and networks FROM debian:bookworm-slim # Metadata ARG VERSION=latest LABEL maintainer="David Binney " LABEL version=$VERSION -LABEL description="This container is a utility for testing within cluster or networks and not needing to install tooling" +LABEL description="This is a utility for testing within cluster or networks and not needing to install tooling" ENV TZ="Australia/Adelaide" @@ -13,21 +12,20 @@ WORKDIR /app COPY ./*.sh /app/ -# Update and install basic tools -RUN apt-get update && apt-get install -y \ - dnsutils netcat-openbsd curl wget tar gnupg vim tmux zsh screenfetch && \ - postgresql-client redis-tools && \ - git golang nodejs npm && \ +# Update and install all required tools in one RUN command to minimize layers +RUN apt-get update && apt-get install -y --no-install-recommends \ + dnsutils netcat-openbsd curl wget tar gnupg vim tmux zsh \ + postgresql-client redis-tools git golang nodejs npm && \ apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# # Install MongoDB tools -# RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor && \ -# echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list && \ -# apt-get update && apt-get install -y mongodb-org-tools && \ +# Uncomment and modify the MongoDB tools installation if needed +# RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg && \ +# echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] http://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list && \ +# apt-get update && apt-get install -y --no-install-recommends mongodb-org-tools && \ # apt-get clean && \ -# rm -rf /var/lib/apt/lists/* +# rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN ./kickstart.sh -ENTRYPOINT ["zsh", "/app/sleeper.sh"] \ No newline at end of file +ENTRYPOINT ["zsh", "/app/sleeper.sh"]