diff --git a/projects/README.md b/projects/README.md index 405acbaf27e603ba1594a705c904d71d9282dccf..8e5fb91c4454b4ab8681172b6269663d0d924cc7 100644 --- a/projects/README.md +++ b/projects/README.md @@ -10,7 +10,9 @@ The [`docker`](projects/docker/) directory does not host a modelling project. It Adding projects: - file permissions for the translation script (755) so it can be executed by any user +- mention .dockerignore in projects README.md, like when adding projects consider..., add a reference to it, in the docker/README.md + --> -<!-- LocalWords: README +<!-- LocalWords: README dockerignore --> diff --git a/projects/docker/README.md b/projects/docker/README.md index ea4f89240d808e148fa844f9eb959d1fb71e4776..958a5d304baee167ed92837d6cfa0e82a69fbeab 100644 --- a/projects/docker/README.md +++ b/projects/docker/README.md @@ -108,28 +108,28 @@ In the interactive shell, the `convert2modelcif` command is available, as well a Be aware of the `touch .history` command before `docker run`. This makes sure a file `.history` exists before starting the Docker container. If the file does not exist, Docker will create a directory `.history` itself but that does not record the bash command history. -<!-- -- Do single example call -- show how to loop -- all build use local UID! - -3. Interactive shell -4. Development environment -- include pylint, black and pyproject.toml ---> - -<!-- -build: -- execute: docker build -f docker/Dockerfile -t converter . -- mention dev stuff -- mention .dockerignore in projects readme, like when adding projects consider..., add a reference to it, here - -run interactive shell for development: -- make sure files exist: /Users/stefan/Projects/ma-converters.git/projects/pointmutations-haddock/.docker-bash-history -- execute: -docker run --rm -i -v /Users/stefan/.bash_profile:/home/mmcif/.bash_profile -v /Users/stefan/.bash_aliases:/home/mmcif/.bash_aliases -v /Users/stefan/.bashrc:/home/mmcif/.bashrc -v /Users/stefan/Projects/ma-converters.git/projects/pointmutations-haddock/.docker-bash-history:/home/mmcif/.bash_history -v /Users/stefan/Projects/ma-converters.git/:/develop -t mmcifconverter:20220427 bash - --> +### Build the development Docker container + +The [Dockerfile](./Dockerfile) has an additional build argument, `ADD_DEV`. If set to `YES`, the follwoing development tools are added to the Docker image: + +- [Emacs](https://www.gnu.org/software/emacs/) + +- [Black](https://black.readthedocs.io/en/stable/) + +- [Pylint](https://pylint.org) + +None of these are needed to run a translation script. + +For working on a translation script, it is convenient to mount the complete Git repository when running the Docker container interactively. This makes sure `pyproject.toml` is available from the repository root to `black` and `pylint`: + +```terminal +$ touch .history +$ docker run --rm -i -t -v /home/user/models:/data -v $HOME/.bashrc:/home/mmcif/.bashrc -v $(pwd)/.history:/home/mmcif/.bash_history -v $(pwd)/../:/develop -t converter:latest bash +$ +``` + +In the session, the Git repository can be found in `/develop`. <!-- LocalWords: TOC modelcif cd whoami localuser uid arg CONVERTERSCRIPT LocalWords: CONVERTERCMD cif ASFVG BUILDKIT pwd