Skip to content

Commit 6b0b9da

Browse files
authored
Update docker-security.yml
1 parent 83ff899 commit 6b0b9da

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Validate Docker Image with Trivy (docker-compose)
1+
name: 🔍 Validate Docker Image with Trivy (docker-compose)
22

33
on:
44
pull_request:
@@ -17,14 +17,18 @@ jobs:
1717
- name: 🐳 Set up Docker Compose
1818
run: sudo apt-get update && sudo apt-get install -y docker-compose
1919

20-
- name: 🛠️ Build image with docker compose
21-
run: docker compose build
20+
- name: 🛠️ Build image without cache
21+
run: docker compose build --no-cache
2222

23-
- name: 🔍 Scan local image with Trivy
24-
uses: aquasecurity/trivy-action@master
25-
with:
26-
image-ref: python-samples-fastapi-restful:latest # tu nombre de imagen real
27-
format: table
28-
exit-code: 1
29-
ignore-unfixed: true
30-
severity: CRITICAL,HIGH
23+
- name: 🐳 List Docker images (debug)
24+
run: docker images
25+
26+
- name: 🔍 Run Trivy via Docker (scan local image)
27+
run: |
28+
docker run --rm \
29+
-v /var/run/docker.sock:/var/run/docker.sock \
30+
-v $HOME/.cache:/root/.cache/ \
31+
aquasec/trivy:latest \
32+
image --format table --exit-code 1 --ignore-unfixed \
33+
--severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL \
34+
python-samples-fastapi-restful:latest

0 commit comments

Comments
 (0)