Skip to content

Commit 559e5fb

Browse files
authored
docker-pipeline
1 parent c3743b0 commit 559e5fb

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

.github/workflows/docker-pipeline.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,10 @@ jobs:
2222
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
2323
restore-keys: |
2424
${{ runner.os }}-docker-
25-
- name: Build the Docker image
26-
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
25+
- name: Build demo-app Docker image
26+
run: docker build . --file Dockerfile --tag demo-app:latest
27+
- name: Pull postgres:15-alpine Docker image
28+
run: docker pull postgres:15-alpine
2729

28-
security_test:
29-
runs-on: ubuntu-latest
30-
needs: docker_build
31-
32-
steps:
33-
- name: Check code
34-
uses: actions/checkout@v4
35-
36-
- name: Install Trivy
37-
run: |
38-
curl -sfL https://github.com/aquasecurity/trivy/releases/download/v0.35.0/trivy_0.35.0_Linux-64bit.deb -o trivy.deb
39-
sudo dpkg -i trivy.deb
40-
41-
- name: Scan demo-app Docker image for vulnerabilities
42-
run: trivy image --exit-code 1 --no-progress demo-app:$(date +%s)
4330

44-
- name: Scan postgres:15-alpine Docker image for vulnerabilities
45-
run: trivy image --exit-code 1 --no-progress postgres:15-alpine
4631

0 commit comments

Comments
 (0)