Skip to content

Commit

Permalink
chore: update docs for Python Docker
Browse files Browse the repository at this point in the history
- link to all the image tags for all languages
- update Python examples to show all supported
scan types
  • Loading branch information
lili2311 committed Jan 28, 2020
1 parent 0bbeda5 commit 263fc72
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Please see the following examples on how to run Snyk inside docker:

### Node.js (npm)

[See all snyk/snyk-cli npm images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=npm)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.

Here's an example of running `snyk test` and `snyk monitor` in the image (with the latest version of Snyk) for npm:
Expand All @@ -103,6 +105,8 @@ docker run -it

### RubyGems

[See all snyk/snyk-cli rubygems images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=rubygems)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.

Here's an example of running `snyk test` and `snyk monitor` in the image (with the latest version of Snyk) for RubyGems:
Expand All @@ -118,6 +122,8 @@ docker run -it

### Maven 3.5.4

[See all snyk/snyk-cli maven images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=maven)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.
You may also need to mount the local `.m2` and `.ivy2` folders.

Expand All @@ -136,6 +142,8 @@ docker run -it

### SBT 0.13.16 / SBT 1.0.4

[See all snyk/snyk-cli sbt images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=sbt)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.
You may also need to mount the local `.m2` and `.ivy2` folders.

Expand Down Expand Up @@ -166,6 +174,8 @@ docker run -it

### Gradle 2.8 / Gradle 4.4 / Gradle 5.4

[See all snyk/snyk-cli gradle images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=gradle)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.
You may also need to mount the local `.gradle`.

Expand Down Expand Up @@ -203,6 +213,8 @@ docker run -it

### Docker

[See all snyk/snyk-cli gradle images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=docker)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.

The image being tested is expected to be available locally.
Expand All @@ -219,6 +231,48 @@ docker run -it
snyk/snyk-cli:docker test --docker myapp:mytag --file=<DOCKERFILE>
```

### Python 2 / Python 3

[See all snyk/snyk-cli python images](https://hub.docker.com/r/snyk/snyk-cli/tags?page=1&name=python)

The host project folder will be mounted to `/project` on the container and will be used to read the dependencies file and write results for CI builds.

Here's an example of running `snyk test` and `snyk monitor` in the image (with the latest version of Snyk) for Maven:

- *setup.py*
```
docker run -it
-e "SNYK_TOKEN=<TOKEN>"
-e "USER_ID=1234"
-e "MONITOR=true"
-e "TARGET_FILE=setup.py"
-v "<PROJECT_DIRECTORY>:/project"
snyk/snyk-cli:python-3 test --org=my-org-name
```

- *Pipfile*
```
docker run -it
-e "SNYK_TOKEN=<TOKEN>"
-e "USER_ID=1234"
-e "MONITOR=true"
-e "TARGET_FILE=Pipfile"
-v "<PROJECT_DIRECTORY>:/project"
snyk/snyk-cli:python-3 test --org=my-org-name
```

- *requirements.txt*

```
docker run -it
-e "SNYK_TOKEN=<TOKEN>"
-e "USER_ID=1234"
-e "MONITOR=true"
-e "TARGET_FILE=requirement-dev.txt"
-v "<PROJECT_DIRECTORY>:/project"
snyk/snyk-cli:python-3 test --org=my-org-name
```

## Badge

Make users feel more confident in using your website by adding your Snyk badge!
Expand Down

0 comments on commit 263fc72

Please sign in to comment.