Sign inSign up

pegi3s/bdip-tools

By pegi3s

Updated about 2 months ago

Image
0

3.8K

pegi3s/bdip-tools repository overview

BDIP Tools Docker Image

1. Initial configuration

1.1 Settings directory

First, create a local directory to share with the Docker container where BDIP Tools will store configuration files:

mkdir /home/<username>/.bdip_tools

Where <username> is your actual username.

1.2 Docker execution and command alias

The general command is:

PATH_TO_DOCKERFILES_PROJECT="/path/to/dockerfiles"
docker run --rm -it --group-add $(getent group docker | cut -d: -f3) --user $(id -u):$(id -g) -v /var/run/docker.sock:/var/run/docker.sock -v "/home/<username>/.bdip_tools:/home/bdip-user/.config/bdip-tools" -v "${PATH_TO_DOCKERFILES_PROJECT}:${PATH_TO_DOCKERFILES_PROJECT}" -w "${PATH_TO_DOCKERFILES_PROJECT}" pegi3s/bdip-tools

Where you must:

  • Set PATH_TO_DOCKERFILES_PROJECT to the local path in your computer where you have the pegi3S Dockerfiles project.
  • Set /home/<username>/.bdip_tools to the local path in which store BDIP Tools settings (created in the previous step).

For convenience, you can set an alias:

alias bdip-docker='docker run --rm -it --group-add $(getent group docker | cut -d: -f3) --user $(id -u):$(id -g) -v /var/run/docker.sock:/var/run/docker.sock -v "/home/<username>/.bdip_tools:/home/bdip-user/.config/bdip-tools" -v "/path/to/dockerfiles:/path/to/dockerfiles" -w "/path/to/dockerfiles" pegi3s/bdip-tools'

Obtaining command help is therefore straightforward with bdip-docker <command> -h, for instance:

bdip-docker settings -h
bdip-docker test-images -h

Note: some commands may have parameters that refer to input or output paths (e.g. --credentials <path> or --output <path>). In this case, you must take into account that you must add the corresponding mounts to the docker run command or work within the project directory.

1.3 Establishing general settings

This step is important because it allows configuring the GitHub API Key (for operations using the GitHub API) and the path to the pegi3S BDIP project, so that there is no need to specify it in every command invocation.

Run the following command to stablish the general settings:

bdip-docker settings

If you want to skip a specific setting and leave it with the default value or not configured, just press Enter and continue.

2. Examples

bdip-docker add-missing-copyrights --dry-run
bdip-docker check-broken-links

2.3 Running hadolint

bdip hadolint --image seqkit # check all seqkit Dockerfiles
bdip hadolint --path seqkit/2.x/Dockerfile  3 checks a specific Dockerfile

2.4 Download test data

First, create a temporary folder and update the alias to use this folder as working directory inside the Docker container:

mkdir /tmp/test-bdip-tools && cd /tmp/test-bdip-tools

alias bdip-docker='docker run --rm -it --group-add $(getent group docker | cut -d: -f3) --user $(id -u):$(id -g) -v /var/run/docker.sock:/var/run/docker.sock -v "/home/<username>/.bdip_tools:/home/bdip-user/.config/bdip-tools" -v "/path/to/dockerfiles:/path/to/dockerfiles" -v "/tmp/test-bdip-tools:/tmp/test-bdip-tools" -w "/tmp/test-bdip-tools" pegi3s/bdip-tools'

And now test these commands (add --host <host> --username <username> if not configured using bdip settings):

bdip-docker download-test-data --list
cat test_data_list.txt | head -2 > filter.txt
bdip-docker download-test-data --dry-run --filter filter.txt
bdip-docker download-test-data --filter filter.txt
bdip-docker download-test-data --filter filter.txt
bdip-docker download-test-data --filter filter.txt  --force

Tag summary

Content type

Image

Digest

sha256:286678409

Size

138.4 MB

Last updated

about 2 months ago

docker pull pegi3s/bdip-tools