semvec/pypi-packages huggingface dataset:
iseqdockertools 0.0.3
Intelliseq tools needed to manage dockers
Requires Python: >=3.6

##### Install iseqdockertools lib

Optional steps (create virtual environment):
```
python3 -m venv venv
source tutorial_env/bin/activate
```


Obligatory steps:
```
python3 -m pip install --upgrade pip
pip install iseqdockertools
```

##### File containing versions for tools: docker-versions.json

In workflows' directory it is located in `src/main/resources/docker-versions.json`
It contains info about the tools' versions in .json format.
For example:
```
{
    "PHARMCAT_VER": "2.3.0",
    "FASTQC_VER": "0.12.1"
}
```
To update it you need to use iseqresources.
The details are there: https://gitlab.com/intelliseq/iseqresources

##### Build docker images

Script automatically takes name and version of the docker image from its header.
It has to be in the following format (at the beginning of the Dockerfile):
```
# name: name
# version: 1.0.0
```

If you want to update the tools' versions automatically:
1. Check if it is generated by iseqresources to the docker-versions.json
2. Add to the beginning of dockerfile (below `FROM`)
```
ARG TOOL1_VER
ARG TOOL2_VER
```
3. The version (if found) will be automatically taken from the docker-versions.json

Building has default context to repository and you can use ADD with path to the files from here. 
Default option is to push to the dockerhub. If the dockerfile exists it won't be pushed. To develop dockerimage locally use flag --nopush. 

##### Usage (when you are in workflows' root directory):
```
dockerbuilder -d path/to/dockerfile
```
for example: 
```
dockerbuilder -d src/main/docker/reports/reports/Dockerfile
```
Script dockerbuider contains --help section with all the flags:

1. Print 'docker build' and 'docker push' logs
```
dockerbuilder -d path/to/dockerfile --quiet
```
2. Do not push docker image(s) to repository
```
dockerbuilder -d path/to/dockerfile --nopush
```
3. Do not use cache when building the docker image(s)
```
dockerbuilder -d path/to/dockerfile --nocache
```
4. Build separate images for all chromosomes
```
dockerbuilder -d path/to/dockerfile --chromosome
```
5. Provide custom path to docker-versions.json
```
dockerbuilder -d path/to/dockerfile --versions
```
6. Ignore docker-versions.json
```
dockerbuilder -d path/to/dockerfile --ignore-versions
```
7. Ignore version number from image name (for example # name tool-1.15b version won't be updated to the newest found (tool-1.18c) in docker-versions.json)
```
dockerbuilder -d path/to/dockerfile --ignore-name-version
```
8. Push image even if exists in repository
```
dockerbuilder -d path/to/dockerfile --forcepush
```
9. Set current directory as context
```
dockerbuilder -d path/to/dockerfile --context
```

You can mix flags whenever you need to.

##### Name of the docker image vs location of its dockerfile

Location: 
```src/main/docker/[catalog-name]/[version]/Dockefile```

Name of the image: ```intelliseqngs/[catalog-name]:[version]```


More info here:
https://workflows-dev-documentation.readthedocs.io/en/latest/Docker.html