{"id":14155136,"url":"https://github.com/BrainTwister/docker-devel-env","last_synced_at":"2025-08-06T00:33:25.289Z","repository":{"id":81000690,"uuid":"120633837","full_name":"BrainTwister/docker-devel-env","owner":"BrainTwister","description":"Fast, reproducible, and portable software development environments","archived":false,"fork":false,"pushed_at":"2021-12-08T11:07:31.000Z","size":358,"stargazers_count":89,"open_issues_count":1,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-05T17:34:04.961Z","etag":null,"topics":["clang","cmake","conan","cuda","development","docker","eclipse","gcc","jenkins","nsight","portability","reproducibility","vscode"],"latest_commit_sha":null,"homepage":"https://braintwister.eu/posts/2018-01-16-record.html","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrainTwister.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-02-07T15:35:47.000Z","updated_at":"2024-01-27T09:14:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"44fe373d-3fbd-4512-90aa-6369776b11d1","html_url":"https://github.com/BrainTwister/docker-devel-env","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Fdocker-devel-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Fdocker-devel-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Fdocker-devel-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Fdocker-devel-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrainTwister","download_url":"https://codeload.github.com/BrainTwister/docker-devel-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215735785,"owners_count":15923388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","cmake","conan","cuda","development","docker","eclipse","gcc","jenkins","nsight","portability","reproducibility","vscode"],"created_at":"2024-08-17T08:02:13.036Z","updated_at":"2024-08-17T08:04:41.845Z","avatar_url":"https://github.com/BrainTwister.png","language":"Dockerfile","funding_links":[],"categories":["vscode"],"sub_categories":[],"readme":"[![Build Status](https://jenkins.braintwister.eu/buildStatus/icon?job=BrainTwister/docker-devel-env/master)](https://jenkins.braintwister.eu/job/BrainTwister/job/docker-devel-env/job/master/)\n\n# Docker Development Environment\n\nFast, reproducible, and portable software development environments\n\nCopyright (C) 2021 Bernd Doser, bernd.doser@braintwister.eu\n\nAll rights reserved.\n\nBrainTwister docker-devel-env is free software made available under the [MIT License](http://opensource.org/licenses/MIT).\nFor details see [the license file](LICENSE).\n\n\n## Advantages\n\n * Fast build and execution compared to virtual machines\n * Portability: Same environment on different machines, platforms, and operating systems\n * Reproducible behaviors\n * Economical consumption of resources\n * Identical environment for development IDE and continuous integration\n * Easy provisioning of images \n\n\n## Docker images\n\nEach directory correspond to an environment module. They can stick together as\na chain:\n\n`module1` - `module2` - `module3` - `...`\n\nThe image `module1-module2-module3` is using the image `module1-module2` as\nbase, which will be set using the build-time variable `BASE_IMAGE`. For\nexample the image `ubuntu-20.04-clang-12` will be build with\n\n```bash\ncd clang-12\ndocker build -t braintwister/ubuntu-20.04-clang-12 --build-arg BASE_IMAGE=braintwister/ubuntu-20.04 .\n```\n\nPlease find a list of available images at [images.yml](images.yml).\nThe images in the list will be build automatically with\n[Jenkins](https://jenkins.braintwister.eu/job/BrainTwister/job/docker-devel-env/)\nand pushed to [DockerHub](https://hub.docker.com/u/braintwister/dashboard/).\n\nThe docker images can be pulled with\n\n```bash\ndocker pull braintwister/\u003cimage-name\u003e\n```\n\n![Docker scheme](https://braintwister.eu/images/docker-devel-env.jpg?)\n\n## Eclipse IDE\n### Eclipse IDE for C++ development\n\nA ready-for-action eclipse IDE with \n\n * clang\n * CMake\n * conan.io\n\ninstalled can be started by\n\n```bash\ndocker run -d -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY --privileged \\\n  braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09\n```\n\nor using docker-compose by\n\n```yaml\nversion: \"3\"\nservices:\n\n  eclipse:\n    image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09\n    volumes:\n      - /tmp/.X11-unix:/tmp/.X11-unix:ro\n    environment:\n      - DISPLAY\n    privileged: true\n```\n\nThe mount of the X11 socket file (/tmp/.X11-unix) and the definition of the\nenvironment variable `DISPLAY` induce the application within the container to\nsend the rendering instructions to the host X server. To allow the container to\nuse the host display, the command `xhost +local:` must be executed on the host\nbefore starting the container. The privileged mode is needed for debugging with\ngdb.\n\n\n### Eclipse IDE for CUDA development\n\nFirst of all [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) version 2\nmust be installed and the runtime attribute must be set to `nvidia`, that the\ncontainer get access to the host GPU card. The nvidia runtime attribute is\ncurrently only available at docker-compose version 2.3.\n\nFor CUDA development the NVIDIA IDE\n[nsight](https://developer.nvidia.com/nsight-eclipse-edition) is highly\nrecommended, because it provides special support for code editing, debugging,\nand profiling. The version of nsight is not adjustable, as it depends to the\nversion of the cuda module.\n\n```yaml\nversion: \"2.3\"\nservices:\n\n  eclipse:\n    image: braintwister/cuda-devel-11.4.2-clang-12-nsight\n    runtime: nvidia\n    volumes:\n      - /tmp/.X11-unix:/tmp/.X11-unix:ro\n    environment:\n      - DISPLAY\n    privileged: true\n```\n\n\n### Eclipse IDE for embedded development\n\nFor embedded programming you have to bind the host serial port (here:\n/dev/ttyACM0) to get a connection to the embedded platform (Arduino, ESP32,\n...).\n\n```yaml\nversion: \"3\"\nservices:\n\n  eclipse:\n    image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09\n    volumes:\n      - /tmp/.X11-unix:/tmp/.X11-unix:ro\n      - /dev/ttyACM0:/dev/ttyACM0\n    environment:\n      - DISPLAY\n    privileged: true\n```\n\n## Visual Studio Code\n\nThe Visual Studio Code IDE can be started by using\n\n```bash\ndocker run -d -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY --privileged \\\n  braintwister/ubuntu-20.04-clang-12-vscode-1.62.3\n```\n\n\n## Persistent storage\n\nThe data in the container can be made persistent by using a [docker\nvolume](https://docs.docker.com/storage/volumes/) `home` for the home directory\n`/home/user`.\n\n```yaml\nversion: \"3\"\nservices:\n\n  eclipse:\n    image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09\n    volumes:\n      - /tmp/.X11-unix:/tmp/.X11-unix:ro \n      - home:/home/user\n    environment:\n      - DISPLAY\n    privileged: true\n\nvolumes:\n  home:\n```\n\n\n## Project-assigned development environment\n\nThe docker development environment can be directly stored within the source\ncode repository and is able to bind the working directory of the source code\ninto the development container. Therefore, the user in the container must be\nthe owner of the source code working directory on the host.  The user in the\ncontainer can be set with the environment variables `USER_ID`, `GROUP_ID`,\n`USER_NAME`, and `GROUP_NAME`. In the following example the docker-compose file\nis stored in the root directory of a git repository. Starting `docker-compose\nup -d` in the root directory the current directory `.` will be bound to\n`/home/${USER_NAME}/git/${PROJECT}`. It is recommended to set the variables in\nan extra file `.env`, which is not controlled by the source control management,\nso that the docker-compose file must not be changed.\n\n```yaml\nversion: \"3\"\nservices:\n\n  vscode:\n    image: braintwister/ubuntu-20.04-clang-12-vscode-1.62.3\n    volumes:\n      - /tmp/.X11-unix:/tmp/.X11-unix:ro \n      - home:/home/${USER_NAME}\n      - .:/home/${USER_NAME}/git/${PROJECT}\n    environment:\n      - DISPLAY\n      - USER_ID=${USER_ID}\n      - GROUP_ID=${GROUP_ID}\n      - USER_NAME=${USER_NAME}\n      - GROUP_NAME=${GROUP_NAME}\n    privileged: true\n\nvolumes:\n  home:\n```\n\nThe `.env`-file can be generated by\n\n```bash\ncat \u003c\u003c EOT \u003e .env \nPROJECT=`basename \"$PWD\"`\nUSER_ID=`id -u $USER`\nGROUP_ID=`id -g $USER`\nUSER_NAME=`id -un $USER`\nGROUP_NAME=`id -gn $USER`\nEOT\n```\n\n\n## Jenkins build container\n\nA declarative Jenkinsfile can look like\n\n```groovy\npipeline {\n\n  agent {\n    docker {\n      image 'braintwister/ubuntu-20.04-clang-12'\n    }\n  }\n\n  stages {\n    stage('Conan') {\n      steps {\n        sh 'conan install .'\n      }\n    }\n    stage('CMake') {\n      steps {\n        sh 'cmake .'\n      }\n    }\n    stage('Build') {\n      steps {\n        sh 'make all'\n      }\n    }\n    stage('Test') {\n      steps {\n        sh 'make test'\n      }\n    }\n  }\n}\n```\n\n## TensorFlow\n\nFor machine learning development we provide with an installation of the\nopen-source framework [TensorFlow](https://github.com/tensorflow/tensorflow)\nusing the latest cuda development drivers.\n\nAlthough the usage of GPUs is highly recommended\n`braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0`, a CPU version is\nalso available `braintwister/ubuntu-20.04-tensorflow-2.0`.\n\nStart a plain container with\n\n```bash\ndocker run -it --runtime=nvidia braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0\n```\n\n[TensorBoard](https://www.tensorflow.org/guide/summaries_and_tensorboard)\nis available at `localhost:6006`, if `-p 6006:6006` was added to the `docker\nrun` command and tensorboard was launched within the container.\n\n\n### TensorFlow with Visual Studio Code\n\nTo allow the container to use the host display, the command `xhost +local:`\nmust be executed on the host before starting the container.\n\n```bash\ndocker run -d --runtime=nvidia -e DISPLAY \\\n  braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0-vscode-1.62.3\n```\n\n\n### TensorFlow with Jupyter\n\nStart the container with\n\n```bash\ndocker run --runtime=nvidia -p 8888:8888 \\\n  braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0-jupyter-1.0\n```\n\nand open localhost:8888 on your host browser.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrainTwister%2Fdocker-devel-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBrainTwister%2Fdocker-devel-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBrainTwister%2Fdocker-devel-env/lists"}