Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI Docker Scout

on:
push:
branches:
- main
- fix/attestation-docs
pull_request:

jobs:
scout:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker
uses: docker/setup-buildx-action@v3

# Login a Docker Hub
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

# Instalar Docker Scout
- name: Install Docker Scout
run: |
curl -sSfL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh | sh -s --

# Verificar instalación
- name: Verify installation
run: docker scout version

# Ejecutar análisis
- name: Run Docker Scout Quickview
run: docker scout quickview alpine

- name: Run Docker Scout CVEs
run: docker scout cves alpine

# =========================
# PRUEBAS UNITARIAS
# =========================

- name: Install Python
run: sudo apt-get update && sudo apt-get install -y python3 python3-pip

- name: Install pytest
run: pip3 install pytest

- name: Run unit tests
run: pytest
82 changes: 0 additions & 82 deletions .github/workflows/release-branch.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,33 @@ definitions:
docker:
memory: 2048 # Optional: Increase if needed
```
## Attestation Commands

The following attestation subcommands are available:

### docker scout attest get
Retrieve attestation data for a specific image.

Example:
docker scout attest get <image>

### docker scout attest list
List available attestations for an image.

Example:
docker scout attest list <image>

### Additional Flags

--predicate-type
Specifies the type of predicate for filtering attestations.

--verify
Verifies the integrity and authenticity of the image.

This example assumes two secrets to be available to authenticate against Docker Hub, called `DOCKER_HUB_USER` and `DOCKER_HUB_PAT`, also is necessary more two secrets called `CI_REGISTRY`, `CI_REGISTRY_IMAGE` about registry info.

## License

The Docker Scout CLI is licensed under the Terms and Conditions of the [Docker Subscription Service Agreement](https://www.docker.com/legal/docker-subscription-service-agreement/).

18 changes: 18 additions & 0 deletions test_scout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import subprocess

def test_docker_scout_installed():
result = subprocess.run(
["docker", "scout", "version"],
capture_output=True,
text=True
)
assert result.returncode == 0


def test_docker_scout_quickview():
result = subprocess.run(
["docker", "scout", "quickview", "alpine"],
capture_output=True,
text=True
)
assert "Target" in result.stdout