Skip to content

Commit

Permalink
change version for alpine, aliyun-cli & integrate trivy in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
devbyteops committed Dec 24, 2024
1 parent f74e150 commit 3ce81b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
runs-on: ubuntu-latest
env:
IMG_NAME: ${{ github.repository }}
IMG_VERSION: "0.0.3"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -24,27 +25,22 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: metadata
uses: docker/metadata-action@v5

- name: Build docker image
run: docker build -t docker.io/${{ github.repository }}:${{ IMG_VERSION }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
images: ${{ env.IMG_NAME }}
tags: |
# type=sha
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
image-ref: 'docker.io/${{ github.repository }}:${{ IMG_VERSION }}'
format: 'table'
exit-code: '1'
severity: 'CRITICAL.HIGH'

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.metadata.outputs.tags }}
tags: devbyteops/aliyun-cli:0.0.2
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ github.repository }}:${{ IMG_VERSION }}
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM alpine:3.20.2
ARG ALIYUN_VERSION=3.0.216
FROM alpine:3.21.0

LABEL author="Taruf Khan <https://github.com/devbyteops>"
LABEL description="Alpine based dockerfile for aliyun cli"
MAINTAINER "Taruf Khan <[email protected]>"

ARG ALIYUN_VERSION=3.0.240
RUN apk update && apk add --no-cache bash
RUN wget https://aliyuncli.alicdn.com/aliyun-cli-linux-${ALIYUN_VERSION}-amd64.tgz && \
tar -xvzf aliyun-cli-linux-${ALIYUN_VERSION}-amd64.tgz && \
Expand Down

0 comments on commit 3ce81b7

Please sign in to comment.