Skip to content
Snippets Groups Projects
Commit 98854913 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

Fix/update project paths in docker setup.

parent 03c14176
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ COPY --chmod=755 docker/entrypoint.sh / ...@@ -53,7 +53,7 @@ COPY --chmod=755 docker/entrypoint.sh /
## Copy tool(s) ## Copy tool(s)
ARG CONVERTERSCRIPT=CoFFE-sponge-proteins/translate2modelcif.py ARG CONVERTERSCRIPT=2025-01-ma-idk-u2osmap/translate2modelcif.py
ARG CONVERTERCMD=convert2modelcif ARG CONVERTERCMD=convert2modelcif
ENV CONVERTERCMD=$CONVERTERCMD ENV CONVERTERCMD=$CONVERTERCMD
COPY --chmod=755 $CONVERTERSCRIPT /usr/local/bin/$CONVERTERCMD COPY --chmod=755 $CONVERTERSCRIPT /usr/local/bin/$CONVERTERCMD
......
...@@ -54,11 +54,11 @@ The idea is to copy a translation script from one of the [projects](projects/) i ...@@ -54,11 +54,11 @@ The idea is to copy a translation script from one of the [projects](projects/) i
The whole build of the Docker image, including installing necessary software and copying the translation script, is covered by our [Dockerfile](./Dockerfile). You just need to specify the translation script by [build time argument](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg) `CONVERTERSCRIPT` during [`docker build`](https://docs.docker.com/engine/reference/commandline/build/). By default, the translation script is renamed to `convert2modelcif` to be called as a command. This can be overwritten using build time argument `CONVERTERCMD`. There is also an alias `2cif` to the converter command, which is immutable. The whole build of the Docker image, including installing necessary software and copying the translation script, is covered by our [Dockerfile](./Dockerfile). You just need to specify the translation script by [build time argument](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg) `CONVERTERSCRIPT` during [`docker build`](https://docs.docker.com/engine/reference/commandline/build/). By default, the translation script is renamed to `convert2modelcif` to be called as a command. This can be overwritten using build time argument `CONVERTERCMD`. There is also an alias `2cif` to the converter command, which is immutable.
The following command will build a Docker image named `converter` (with tag `latest`). The translation script will be copied from [`USDA-ASFVG/translate2modelcif.py`](projects/USDA-ASFVG/translate2modelcif.py) and made available as `convert2modelcif` in the Docker image/ `docker run`. By `MMCIF_USER_ID`, we use UID `1234` for the internal user of the Docker image, so mounted files have the right owner inside and outside of the Docker container (assuming the example user from above). Pay attention to the alternative Dockerfile location specified by `-f docker/Dockerfile`, as we are calling `docker build` from the [projects](projects/) subdirectory to get the right build context: The following command will build a Docker image named `converter` (with tag `latest`). The translation script will be copied from [`2025-03-ma-kvko-prsa/translate2modelcif_multi_model.py`](projects/2025-03-ma-kvko-prsa/translate2modelcif_multi_model.py) and made available as `convert2modelcif` in the Docker image/ `docker run`. By `MMCIF_USER_ID`, we use UID `1234` for the internal user of the Docker image, so mounted files have the right owner inside and outside of the Docker container (assuming the example user from above). Pay attention to the alternative Dockerfile location specified by `-f docker/Dockerfile`, as we are calling `docker build` from the [projects](projects/) subdirectory to get the right build context:
```terminal ```terminal
$ # DOCKER_BUILDKIT=1 is only needed for older versions of Docker. $ # DOCKER_BUILDKIT=1 is only needed for older versions of Docker.
$ DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --build-arg MMCIF_USER_ID=1234 --build-arg CONVERTERSCRIPT=USDA-ASFVG/translate2modelcif.py -t converter:latest . $ DOCKER_BUILDKIT=1 docker build -f docker/Dockerfile --build-arg MMCIF_USER_ID=1234 --build-arg CONVERTERSCRIPT=2025-03-ma-kvko-prsa/translate2modelcif_multi_model.py -t converter:latest .
$ $
``` ```
...@@ -85,7 +85,7 @@ $ ...@@ -85,7 +85,7 @@ $
The dedicated translation script is made available inside the Docker container as a direct [bind mount](https://docs.docker.com/storage/bind-mounts/) to the installed converter command. The remaining parameters are the same as for the [app-like](#run-a-fixed-converter-from-within-the-docker-container-app-like) `docker run` command: The dedicated translation script is made available inside the Docker container as a direct [bind mount](https://docs.docker.com/storage/bind-mounts/) to the installed converter command. The remaining parameters are the same as for the [app-like](#run-a-fixed-converter-from-within-the-docker-container-app-like) `docker run` command:
```terminal ```terminal
$ docker run --rm -v /home/user/models:/data -v $(pwd)/USDA-ASFVG/translate2modelcif.py:/usr/local/bin/convert2modelcif -t converter:latest convert2modelcif /data/ /data/proteome_accessions.csv $ docker run --rm -v /home/user/models:/data -v $(pwd)/2025-03-ma-kvko-prsa/translate2modelcif_multi_model.py:/usr/local/bin/convert2modelcif -t converter:latest convert2modelcif /data/ /data/proteome_accessions.csv
$ $
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment