From 668e53f24afdc84ca3e7d4680154b9ac864334f7 Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Mon, 3 Oct 2022 15:58:43 +0200 Subject: [PATCH] Update README.md, building the image --- README.md | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 05e85f5..0bff4ae 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,12 @@ The actual translation script uses [OpenStructure](https://openstructure.org) to [[_TOC_]] + ## Get the translation app There are two ways to get the Docker container: pull it from our [GitLab registry](https://git.scicore.unibas.ch/schwede/ma-wilkins-import/container_registry) or build it from the [Dockerfile](Dockerfile) in this Git repository. + ### Pull the Docker container from GitLab registry Our GitLab registry keeps a copy of the container with the latest code, ready to be downloaded and used right away. With Docker installed, issue the following command in a terminal: @@ -37,9 +39,37 @@ $ The hash values may be different, but with that you have a local copy of the Docker container and can proceed at [Run the translation app](#run-the-translation-app). -<!-- -- build from Dockerfile - --> + +### Build the Docker container from scratch + +If you want to build the container yourself, first clone this Git repository: + +```terminal +$ git clone https://git.scicore.unibas.ch/schwede/ma-wilkins-import.git ma-wilkins-import.git +``` + +And switch into it, so you are in the same directory as the Dockerfile: + +```terminal +cd ma-wilkins-import.git +``` + +Now you can build the Docker container with the following command: + +```terminal +$ DOCKER_BUILDKIT=1 docker build -t registry.scicore.unibas.ch/schwede/ma-wilkins-import/converter:latest . +``` + +`DOCKER_BUILDKIT=1` is only needed for some older versions of Docker. + +The Dockerfile knows two build time arguments (`--build-arg`), `MMCIF_USER_ID` and `ADD_DEV`. The latter is only used for developing the app. `MMCIF_USER_ID` sets the ID of the user running the translation script inside the Docker container. So files written by the Docker container belong to the user ID of the internal user. When you run into file permission issues with the produced ModelCIF files, build the Docker container using your own user ID: + +```terminal +$ DOCKER_BUILDKIT=1 docker build --build-arg MMCIF_USER_ID=<YOUR USER ID> -t registry.scicore.unibas.ch/schwede/ma-wilkins-import/converter:latest . +``` + +Replace `<YOUR USER ID>` with your own ID, e.g. after checking it with the `id` command (look for `uid` in the output). + ## Run the translation app @@ -57,5 +87,5 @@ The hash values may be different, but with that you have a local copy of the Doc --> <!-- LocalWords: ColabFold OpenStructure TOC schwede ccf cbfcc sha ceadc aaf - LocalWords: ae ddfc + LocalWords: ae ddfc wilkins cd BUILDKIT arg DEV uid --> -- GitLab