From a6a563beacd18c9f9fd3294837772df9e6eb7a33 Mon Sep 17 00:00:00 2001 From: Charles Coggins Date: Thu, 28 Sep 2023 20:58:51 -0500 Subject: [PATCH] docs: update documentation * Update the `README.md` with information about the `slim` tag options * Update the dockerfiles with information about how to perform testing --- Dockerfile | 5 +++++ Dockerfile.slim | 5 +++++ README.md | 34 ++++++++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca680d38..f7121253 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.slim b/Dockerfile.slim index 63689423..cf9867d0 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -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 diff --git a/README.md b/README.md index 35c3a6c4..4a4d55cc 100644 --- a/README.md +++ b/README.md @@ -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 `-CLIv`. Here are image tag examples: +version of the Phylum CLI, in the form of `-CLIv`. +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.