@@ -11,7 +11,7 @@ A specific project's translation script can be executed either in an [app like](
This is a quick tour on how to build and run the Docker container through different scenarios. This is not a lecture on containerisation in general, nor Linux/ Unix, shell scripting or programming. But if you encounter a specific problem, feel free to ping the [MA team](https://modelarchive.org/contact).
This section describes four use cases of the Docker container (including a build how-to per use case) but starts with a short primer of what is common to all scenarios described here.
This section describes four use cases of the Docker container (including build instructions per use case) but starts with a short primer of what is common to all scenarios described here.
### Prerequisites
...
...
@@ -24,13 +24,13 @@ $ cd modelcif-converters.git/projects
$
```
Since the Docker container will run as a dedicated, non-root user, it is advisable to create this user with the ID of your local user. That way, file permission issues will be avoided. Get your user ID with the following command and note it down - it will be needed in the build steps:
Since the Docker container will run a dedicated, non-root user internally, it is advisable to create this user with the ID of your local user. That way, file permission issues will be avoided. Get your user ID with the following command and write it down - it will be needed in the build steps:
```terminal
$whoami
localuser
$id
uid=(localuser) ...
uid=1234(localuser) ...
$
```
...
...
@@ -48,7 +48,7 @@ This use case comes closest to having a Docker container that works like a [Mode
- turn into a [Singularity](https://sylabs.io/singularity/) image
and it works out of the box.
and the conversion to ModelCIF works out of the box.
The idea is to copy a translation script from one of the [projects](projects/) into the Docker image along with all the software needed to run it. That enables you to start the script as a command with [`docker run`](https://docs.docker.com/engine/reference/run/).
...
...
@@ -58,10 +58,18 @@ The following command will build a Docker image named `converter` (with tag `lat
```terminal
$# DOCKER_BUILDKIT=1 is only needed for older versions of Docker.
After building the Docker image, its time to run the translation command. To do so, we need to make the data available inside the Docker container. This is achieved by [mounting]((https://docs.docker.com/storage/bind-mounts/)) the model-data directory into the Docker container. In the following example, the local `/home/user/models` directory of the host machine is made available as `/data` inside the container. So the command send to `docker run` has to use `/data` as it is executed inside the container:
```terminal
$docker run --rm-v /home/user/models:/data -t converter:latest convert2modelcif /data/ /data/proteome_accessions.csv