diff options
| author | Adam Janovsky | 2022-06-22 17:54:31 +0200 |
|---|---|---|
| committer | Adam Janovsky | 2022-06-22 17:54:31 +0200 |
| commit | 166f8d96e414e52e66fd225440317bf80c0fc3fb (patch) | |
| tree | 8e1f07937130e3df51aab8699fee5a59770688c3 /docs | |
| parent | 747f4ae880ae390bd3fa829242b3a811294a85ec (diff) | |
| download | sec-certs-166f8d96e414e52e66fd225440317bf80c0fc3fb.tar.gz sec-certs-166f8d96e414e52e66fd225440317bf80c0fc3fb.tar.zst sec-certs-166f8d96e414e52e66fd225440317bf80c0fc3fb.zip | |
better docker instructions
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/installation.md | 3 | ||||
| -rw-r--r-- | docs/quickstart.md | 31 |
2 files changed, 29 insertions, 5 deletions
diff --git a/docs/installation.md b/docs/installation.md index 71e685db..cf76ec8a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -7,6 +7,7 @@ The tool can be installed from PyPi with ```bash pip install -U sec-certs +python3 -m spacy download en_core_web_sm ``` Note, that `Python>=3.8` is required. @@ -27,9 +28,11 @@ docker pull seccerts/sec-certs The stable release is also published on [GitHub](https://github.com/crocs-muni/sec-certs/releases) from where it can be setup for development with ```bash +git clone https://github.com/crocs-muni/sec-certs.git python3 -m venv venv source venv/bin/activate pip install -e . +python3 -m spacy download en_core_web_sm ``` Alternatively, our Our [Dockerfile](https://github.com/crocs-muni/sec-certs/blob/main/Dockerfile) represents a reproducible way of setting up the environment. diff --git a/docs/quickstart.md b/docs/quickstart.md index e16a570d..bcf34231 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -4,7 +4,7 @@ :::{tab-item} Common Criteria 1. Install the latest version with `pip install -U sec-certs` (see [installation](installation.md)). -2. Use +2. In your Python interpreter, type ```python from sec_certs.dataset import CCDataset @@ -17,7 +17,7 @@ to obtain to obtain freshly processed dataset from [seccerts.org](https://seccer :::{tab-item} FIPS 140 1. Install the latest version with `pip install -U sec-certs` (see [installation](installation.md)). -2. Use +2. In your Python interpreter, type ```python from sec_certs.dataset import FIPSDataset @@ -51,6 +51,27 @@ $ fips-certs new-run This script takes a long time to run (few hours) and will create `./cc_dset` or `./fips_dset` directory. To see all options, call the entrypoint with `--help`. -:::{hint} -If you installed the docker image, use `docker run -it sec-certs bash` to run the container interactively. -::: +## Run sec-certs from docker + +If you installed the docker image (see [installation](installation.md)), use `docker run -it sec-certs` to run the container interactively. From there, you can run the `cc-certs` CLI or `fips-certs` CLI. Alternatively, you can serve a Jupyter notebook from the docker to use at your host machine and even write your scripts to some shared folder. Example of both use-cases follow. + +### Persistent files with docker mounts + +It may be handy to create a shared folder between your host machine and the docker image, especially for the artifacts of sec-certs analysis. This can be achieved either by [docker volumes](https://docs.docker.com/storage/volumes/) or [docker bind mounts](https://docs.docker.com/storage/bind-mounts/). An example follows that achieves a shared folder writable from the container. + +```bash +mkdir seccerts-data && \ +docker run -it --mount type=bind,source="$(pwd)"/seccerts-data/,target=/home/user/data seccerts/sec-certs +``` + +The folder should be accessible on your machine on `./seccerts-data` path; from docker on `/home/user/data` path. + +### Run jupyter notebook with sec-certs from Docker + +You can also use our docker image to serve `jupyter notebook` instance that you can access from your device. Run + +```bash +docker run --rm -it -p 8888:8888 seccerts/sec-certs jupyter notebook --no-browser --ip 0.0.0.0 --NotebookApp.token='' --notebook-dir="/home/user/" +``` + +Now, you should be able to access the notebook at `localhost:8888` from your machine. Navigate to `/home/user/sec-certs/notebooks/examples` to see some example notebooks. |
