-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change version for alpine, aliyun-cli & integrate trivy in pipeline
- Loading branch information
1 parent
f74e150
commit 3ce81b7
Showing
2 changed files
with
19 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 && \ | ||
|