From 552a33bc828d50501c47bcf93f16fb9400c82eb1 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 25 Jun 2025 18:32:01 +0000 Subject: [PATCH 1/2] fix: Dockerfile to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-UBUNTU2404-PAM-10379114 - https://snyk.io/vuln/SNYK-UBUNTU2404-PAM-10379114 - https://snyk.io/vuln/SNYK-UBUNTU2404-PAM-10379114 - https://snyk.io/vuln/SNYK-UBUNTU2404-PAM-10379114 - https://snyk.io/vuln/SNYK-UBUNTU2404-PAM-8303372 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7437911..dae8ad1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rabbitmq:3.13.7 +FROM rabbitmq:3.13.7-alpine RUN rabbitmq-plugins enable --offline rabbitmq_management RUN rabbitmq-plugins enable --offline rabbitmq_stomp RUN rabbitmq-plugins enable --offline rabbitmq_web_stomp From 3b80fa97d45fcb2f935f77968c27ed34680598d6 Mon Sep 17 00:00:00 2001 From: spy86 Date: Wed, 25 Jun 2025 20:37:28 +0200 Subject: [PATCH 2/2] Update --- .../docker-image-build-pull-request.yml | 11 --- .github/workflows/docker-publish.yml | 41 ---------- pipelines/azure-pipelines.yaml | 74 +++++++++++++++++++ 3 files changed, 74 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/docker-image-build-pull-request.yml delete mode 100644 .github/workflows/docker-publish.yml create mode 100644 pipelines/azure-pipelines.yaml diff --git a/.github/workflows/docker-image-build-pull-request.yml b/.github/workflows/docker-image-build-pull-request.yml deleted file mode 100644 index 6f67a63..0000000 --- a/.github/workflows/docker-image-build-pull-request.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Build Docker Image on Pull Request -on: - pull_request: - branches: [ "main" ] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag ghcr.io/think-cube/dockerrabbitmqstomp:latest diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index d78fbbe..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Docker -on: - push: - tags: ['v*.*.*'] -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3.0.0 - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@v3.0.0 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5.0.0 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v5.0.0 - with: - context: . - 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/pipelines/azure-pipelines.yaml b/pipelines/azure-pipelines.yaml new file mode 100644 index 0000000..5de450e --- /dev/null +++ b/pipelines/azure-pipelines.yaml @@ -0,0 +1,74 @@ + +name: $(date:yyyyMMdd)-$(rev:.r) + +parameters: +- name: publish_docker + displayName: 'Publish Docker Container ???' + type: string + default: 'false' + values: + - true + - false + +trigger: + branches: + include: + - refs/heads/master + - refs/heads/main + +resources: + repositories: + - repository: self + +variables: + - group: GITHUB-PAT-TOKEN + - name: PUBLISH_DOCKER + value: ${{parameters.publish_docker}} + - name: VM_IMAGE + value: ubuntu-latest + - name: IMAGE_NAME + value: "think-cube/docker-rabbitmq-stomp" + +pool: + vmImage: $(VM_IMAGE) + +stages: +- stage: TestBuild + condition: eq('${{parameters.publish_docker}}', 'false') + displayName: "Build Docker Image" + jobs: + - job: Build + steps: + - script: echo "##vso[task.setvariable variable=IMAGE_TAG]$(date +%Y%m%d)" + displayName: "Set IMAGE_TAG variable" + + - task: Docker@2 + inputs: + repository: '$(IMAGE_NAME)' + command: 'build' + Dockerfile: 'Dockerfile' + tags: '$(IMAGE_TAG)' + +- stage: BuildAndPush + condition: eq('${{parameters.publish_docker}}', 'true') + displayName: "Push Docker Image" + jobs: + - job: Push + steps: + - checkout: self + - script: echo "##vso[task.setvariable variable=IMAGE_TAG]$(date +%Y%m%d)" + displayName: "Set IMAGE_TAG variable" + - task: Docker@2 + inputs: + command: 'login' + containerRegistry: 'ghcr.io' + username: '$(USERNAME)' + password: '$(TOKEN-FOR-GHCR)' + + - task: Docker@2 + inputs: + containerRegistry: 'ghcr.io' + repository: '$(IMAGE_NAME)' + command: 'buildAndPush' + Dockerfile: 'Dockerfile' + tags: '$(IMAGE_TAG)'