Update Docker Hub Scout config to use local login credentials
Some checks failed
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Failing after 1m56s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Some checks failed
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Failing after 1m56s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Replaced the use of Docker Hub secrets with a mounted local docker configuration file for authentication. Added a check to ensure the login config exists before running scans, preventing unnecessary failures. This change enhances flexibility and aligns with local environment setups.
This commit is contained in:
@@ -98,10 +98,13 @@ jobs:
|
||||
echo "Docker Hub Scout scan skipped: DOCKERHUB_USERNAME/DOCKERHUB_TOKEN not set." > scout-backend.txt
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f "$HOME/.docker/config.json" ]; then
|
||||
echo "Docker Hub Scout scan skipped: docker login config not found in runner." > scout-backend.txt
|
||||
exit 0
|
||||
fi
|
||||
docker run --rm \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e DOCKER_SCOUT_HUB_USER="${{ secrets.DOCKERHUB_USERNAME }}" \
|
||||
-e DOCKER_SCOUT_HUB_PAT="${{ secrets.DOCKERHUB_TOKEN }}" \
|
||||
-v "$HOME/.docker:/root/.docker:ro" \
|
||||
docker/scout-cli:latest cves nexapg-backend:dev-scan \
|
||||
--only-severity critical,high,medium,low > scout-backend.txt
|
||||
|
||||
@@ -111,10 +114,13 @@ jobs:
|
||||
echo "Docker Hub Scout scan skipped: DOCKERHUB_USERNAME/DOCKERHUB_TOKEN not set." > scout-frontend.txt
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -f "$HOME/.docker/config.json" ]; then
|
||||
echo "Docker Hub Scout scan skipped: docker login config not found in runner." > scout-frontend.txt
|
||||
exit 0
|
||||
fi
|
||||
docker run --rm \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e DOCKER_SCOUT_HUB_USER="${{ secrets.DOCKERHUB_USERNAME }}" \
|
||||
-e DOCKER_SCOUT_HUB_PAT="${{ secrets.DOCKERHUB_TOKEN }}" \
|
||||
-v "$HOME/.docker:/root/.docker:ro" \
|
||||
docker/scout-cli:latest cves nexapg-frontend:dev-scan \
|
||||
--only-severity critical,high,medium,low > scout-frontend.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user