Skip to content

Commit

Permalink
docs: update documentation
Browse files Browse the repository at this point in the history
* Update the `README.md` with information about the `slim` tag options
* Update the dockerfiles with information about how to perform testing
  • Loading branch information
maxrake committed Sep 29, 2023
1 parent 34ba4b2 commit a6a563b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
# specifying the `entrypoint.sh` script, providing extra parameters as a *quoted* string:
#
# $ docker run --rm --entrypoint entrypoint.sh phylumio/phylum-ci:latest "ls -alh /"
#
# Images built from this Dockerfile can be tested for basic functionality:
#
# $ docker build --tag phylum-ci .
# $ scripts/docker_tests.sh --image phylum-ci
##########################################################################################

FROM python:3.11-slim-bookworm AS builder
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
# specifying the `entrypoint.sh` script, providing extra parameters as a *quoted* string:
#
# $ docker run --rm --entrypoint entrypoint.sh phylumio/phylum-ci:latest "ls -alh /"
#
# Images built from this Dockerfile can be tested for basic functionality:
#
# $ docker build --tag phylum-ci .
# $ scripts/docker_tests.sh --image phylum-ci --slim
##########################################################################################

FROM python:3.11-slim-bookworm AS builder
Expand Down
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,45 @@ docker run --rm phylumio/phylum-ci phylum-ci --help
# Export a Phylum token (e.g., from `phylum auth token`)
export PHYLUM_API_KEY=$(phylum auth token)

# Run it from a git repo directory containing at least one lockfile
# Run it from a git repo directory containing at least one supported lockfile or manifest
docker run -it --rm -e PHYLUM_API_KEY --mount type=bind,src=$(pwd),dst=/phylum -w /phylum phylumio/phylum-ci
```

The Docker image contains `git` and the installed `phylum` Python package.
It also contains an installed version of the Phylum CLI.
An advantage of using the Docker image is that the complete environment is packaged and made available with components
that are known to work together.
The default Docker image contains `git` and the installed `phylum` Python package.
It also contains an installed version of the Phylum CLI and all required tools needed for [lockfile generation].
An advantage of using the default Docker image is that the complete environment is packaged and made available with
components that are known to work together.

One disadvantage to the default image is it's size. It can take a while to download and may provide more tools than
required for your specific use case. Special `slim` tags of the `phylum-ci` image are provided as an alternative.
These tags differ from the default image in that they do not contain the required tools needed for [lockfile generation]
(with the exception of the `pip` tool). The `slim` tags are significantly smaller and will allow integrations relying
on them to complete faster. They are useful for those instances where *no* manifest files are present and/or *only*
lockfiles are used.

```sh
# Get the "latest" `slim` tagged image
docker pull phylumio/phylum-ci:slim
```

When using the `latest` tagged image, the version of the Phylum CLI is the `latest` available.
There are additional image tag options available to specify a specific release of the `phylum-ci` project and a specific
version of the Phylum CLI, in the form of `<phylum-ci version>-CLIv<Phylum CLI version>`. Here are image tag examples:
version of the Phylum CLI, in the form of `<phylum-ci version>-CLIv<Phylum CLI version>`.
Each of these also has a `-slim` variant that does not support [lockfile generation]. Here are image tag examples:

```sh
# Get the most current release of *both* `phylum-ci` and the Phylum CLI
docker pull phylumio/phylum-ci:latest

# Get the image with `phylum-ci` version 0.24.1 and Phylum CLI version 4.7.0
docker pull phylumio/phylum-ci:0.24.1-CLIv4.7.0
# Get the image with `phylum-ci` version 0.35.2 and Phylum CLI version 5.7.1
docker pull phylumio/phylum-ci:0.35.2-CLIv5.7.1

# Get the `slim` image with `phylum-ci` version 0.36.0 and Phylum CLI version 5.7.1
docker pull phylumio/phylum-ci:0.36.0-CLIv5.7.1-slim
```

[lockfile generation]: https://docs.phylum.io/docs/lockfile_generation

#### `phylum-init` Script Entry Point

The `phylum-init` script can be used to fetch and install the Phylum CLI.
Expand Down

0 comments on commit a6a563b

Please sign in to comment.