├── .gitignore ├── Jenkinsfile ├── LICENSE ├── README.md ├── alpine ├── Dockerfile ├── aliases └── entrypoint.sh ├── build.py ├── clang └── Dockerfile ├── cmake └── Dockerfile ├── conan ├── Dockerfile └── conan_add_repositories.sh ├── cuda-devel ├── Dockerfile ├── aliases └── entrypoint.sh ├── cuda-runtime ├── Dockerfile ├── aliases └── entrypoint.sh ├── docker-compose └── docker-compose.yml ├── docker-nightly ├── Dockerfile └── add_user_to_docker_group.sh ├── docker ├── Dockerfile └── add_user_to_docker_group.sh ├── doxygen └── Dockerfile ├── eclipse-cpp ├── Dockerfile ├── entrypoint_eclipse.sh ├── install_plugins.py ├── plugins-2020.09.yml ├── plugins-2021.03.yml ├── plugins-2021.06.yml └── plugins-2021.09.yml ├── gcc └── Dockerfile ├── gcovr └── Dockerfile ├── gitg └── Dockerfile ├── gtest └── Dockerfile ├── images.yml ├── jupyter ├── Dockerfile └── jupyter_notebook_config.py ├── lcov └── Dockerfile ├── nsight ├── Dockerfile ├── install_plugins.py └── plugins.yml ├── nvtop └── Dockerfile ├── softwipe └── Dockerfile ├── tensorflow-gpu └── Dockerfile ├── ubuntu ├── Dockerfile ├── aliases └── entrypoint.sh └── vscode ├── Dockerfile └── keep_running.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /images-*.yml 2 | .env 3 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!groovy 2 | 3 | pipeline { 4 | 5 | agent { 6 | docker { 7 | image 'braintwister/ubuntu-18.04-docker-18.09' 8 | args '-u root -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_CONFIG=/tmp -e USER_ID=1000' 9 | alwaysPull true 10 | } 11 | } 12 | 13 | options { 14 | timeout(time: 24, unit: 'HOURS') 15 | disableConcurrentBuilds() 16 | } 17 | 18 | stages { 19 | stage('Build') { 20 | steps { 21 | withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'dockerhub', 22 | usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { 23 | sh './build.py --latest -vv -u $USERNAME -p $PASSWORD' 24 | } 25 | } 26 | } 27 | } 28 | 29 | post { 30 | success { 31 | mail to: 'bernd.doser@braintwister.eu', subject: "SUCCESS: ${currentBuild.fullDisplayName}", body: "Success: ${env.BUILD_URL}" 32 | } 33 | failure { 34 | mail to: 'bernd.doser@braintwister.eu', subject: "FAILURE: ${currentBuild.fullDisplayName}", body: "Failure: ${env.BUILD_URL}" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2021 Bernd Doser 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![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/) 2 | 3 | # Docker Development Environment 4 | 5 | Fast, reproducible, and portable software development environments 6 | 7 | Copyright (C) 2021 Bernd Doser, bernd.doser@braintwister.eu 8 | 9 | All rights reserved. 10 | 11 | BrainTwister docker-devel-env is free software made available under the [MIT License](http://opensource.org/licenses/MIT). 12 | For details see [the license file](LICENSE). 13 | 14 | 15 | ## Advantages 16 | 17 | * Fast build and execution compared to virtual machines 18 | * Portability: Same environment on different machines, platforms, and operating systems 19 | * Reproducible behaviors 20 | * Economical consumption of resources 21 | * Identical environment for development IDE and continuous integration 22 | * Easy provisioning of images 23 | 24 | 25 | ## Docker images 26 | 27 | Each directory correspond to an environment module. They can stick together as 28 | a chain: 29 | 30 | `module1` - `module2` - `module3` - `...` 31 | 32 | The image `module1-module2-module3` is using the image `module1-module2` as 33 | base, which will be set using the build-time variable `BASE_IMAGE`. For 34 | example the image `ubuntu-20.04-clang-12` will be build with 35 | 36 | ```bash 37 | cd clang-12 38 | docker build -t braintwister/ubuntu-20.04-clang-12 --build-arg BASE_IMAGE=braintwister/ubuntu-20.04 . 39 | ``` 40 | 41 | Please find a list of available images at [images.yml](images.yml). 42 | The images in the list will be build automatically with 43 | [Jenkins](https://jenkins.braintwister.eu/job/BrainTwister/job/docker-devel-env/) 44 | and pushed to [DockerHub](https://hub.docker.com/u/braintwister/dashboard/). 45 | 46 | The docker images can be pulled with 47 | 48 | ```bash 49 | docker pull braintwister/ 50 | ``` 51 | 52 | ![Docker scheme](https://braintwister.eu/images/docker-devel-env.jpg?) 53 | 54 | ## Eclipse IDE 55 | ### Eclipse IDE for C++ development 56 | 57 | A ready-for-action eclipse IDE with 58 | 59 | * clang 60 | * CMake 61 | * conan.io 62 | 63 | installed can be started by 64 | 65 | ```bash 66 | docker run -d -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY --privileged \ 67 | braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09 68 | ``` 69 | 70 | or using docker-compose by 71 | 72 | ```yaml 73 | version: "3" 74 | services: 75 | 76 | eclipse: 77 | image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09 78 | volumes: 79 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 80 | environment: 81 | - DISPLAY 82 | privileged: true 83 | ``` 84 | 85 | The mount of the X11 socket file (/tmp/.X11-unix) and the definition of the 86 | environment variable `DISPLAY` induce the application within the container to 87 | send the rendering instructions to the host X server. To allow the container to 88 | use the host display, the command `xhost +local:` must be executed on the host 89 | before starting the container. The privileged mode is needed for debugging with 90 | gdb. 91 | 92 | 93 | ### Eclipse IDE for CUDA development 94 | 95 | First of all [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) version 2 96 | must be installed and the runtime attribute must be set to `nvidia`, that the 97 | container get access to the host GPU card. The nvidia runtime attribute is 98 | currently only available at docker-compose version 2.3. 99 | 100 | For CUDA development the NVIDIA IDE 101 | [nsight](https://developer.nvidia.com/nsight-eclipse-edition) is highly 102 | recommended, because it provides special support for code editing, debugging, 103 | and profiling. The version of nsight is not adjustable, as it depends to the 104 | version of the cuda module. 105 | 106 | ```yaml 107 | version: "2.3" 108 | services: 109 | 110 | eclipse: 111 | image: braintwister/cuda-devel-11.4.2-clang-12-nsight 112 | runtime: nvidia 113 | volumes: 114 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 115 | environment: 116 | - DISPLAY 117 | privileged: true 118 | ``` 119 | 120 | 121 | ### Eclipse IDE for embedded development 122 | 123 | For embedded programming you have to bind the host serial port (here: 124 | /dev/ttyACM0) to get a connection to the embedded platform (Arduino, ESP32, 125 | ...). 126 | 127 | ```yaml 128 | version: "3" 129 | services: 130 | 131 | eclipse: 132 | image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09 133 | volumes: 134 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 135 | - /dev/ttyACM0:/dev/ttyACM0 136 | environment: 137 | - DISPLAY 138 | privileged: true 139 | ``` 140 | 141 | ## Visual Studio Code 142 | 143 | The Visual Studio Code IDE can be started by using 144 | 145 | ```bash 146 | docker run -d -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e DISPLAY --privileged \ 147 | braintwister/ubuntu-20.04-clang-12-vscode-1.62.3 148 | ``` 149 | 150 | 151 | ## Persistent storage 152 | 153 | The data in the container can be made persistent by using a [docker 154 | volume](https://docs.docker.com/storage/volumes/) `home` for the home directory 155 | `/home/user`. 156 | 157 | ```yaml 158 | version: "3" 159 | services: 160 | 161 | eclipse: 162 | image: braintwister/ubuntu-20.04-clang-12-eclipse-cpp-2021.09 163 | volumes: 164 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 165 | - home:/home/user 166 | environment: 167 | - DISPLAY 168 | privileged: true 169 | 170 | volumes: 171 | home: 172 | ``` 173 | 174 | 175 | ## Project-assigned development environment 176 | 177 | The docker development environment can be directly stored within the source 178 | code repository and is able to bind the working directory of the source code 179 | into the development container. Therefore, the user in the container must be 180 | the owner of the source code working directory on the host. The user in the 181 | container can be set with the environment variables `USER_ID`, `GROUP_ID`, 182 | `USER_NAME`, and `GROUP_NAME`. In the following example the docker-compose file 183 | is stored in the root directory of a git repository. Starting `docker-compose 184 | up -d` in the root directory the current directory `.` will be bound to 185 | `/home/${USER_NAME}/git/${PROJECT}`. It is recommended to set the variables in 186 | an extra file `.env`, which is not controlled by the source control management, 187 | so that the docker-compose file must not be changed. 188 | 189 | ```yaml 190 | version: "3" 191 | services: 192 | 193 | vscode: 194 | image: braintwister/ubuntu-20.04-clang-12-vscode-1.62.3 195 | volumes: 196 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 197 | - home:/home/${USER_NAME} 198 | - .:/home/${USER_NAME}/git/${PROJECT} 199 | environment: 200 | - DISPLAY 201 | - USER_ID=${USER_ID} 202 | - GROUP_ID=${GROUP_ID} 203 | - USER_NAME=${USER_NAME} 204 | - GROUP_NAME=${GROUP_NAME} 205 | privileged: true 206 | 207 | volumes: 208 | home: 209 | ``` 210 | 211 | The `.env`-file can be generated by 212 | 213 | ```bash 214 | cat << EOT > .env 215 | PROJECT=`basename "$PWD"` 216 | USER_ID=`id -u $USER` 217 | GROUP_ID=`id -g $USER` 218 | USER_NAME=`id -un $USER` 219 | GROUP_NAME=`id -gn $USER` 220 | EOT 221 | ``` 222 | 223 | 224 | ## Jenkins build container 225 | 226 | A declarative Jenkinsfile can look like 227 | 228 | ```groovy 229 | pipeline { 230 | 231 | agent { 232 | docker { 233 | image 'braintwister/ubuntu-20.04-clang-12' 234 | } 235 | } 236 | 237 | stages { 238 | stage('Conan') { 239 | steps { 240 | sh 'conan install .' 241 | } 242 | } 243 | stage('CMake') { 244 | steps { 245 | sh 'cmake .' 246 | } 247 | } 248 | stage('Build') { 249 | steps { 250 | sh 'make all' 251 | } 252 | } 253 | stage('Test') { 254 | steps { 255 | sh 'make test' 256 | } 257 | } 258 | } 259 | } 260 | ``` 261 | 262 | ## TensorFlow 263 | 264 | For machine learning development we provide with an installation of the 265 | open-source framework [TensorFlow](https://github.com/tensorflow/tensorflow) 266 | using the latest cuda development drivers. 267 | 268 | Although the usage of GPUs is highly recommended 269 | `braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0`, a CPU version is 270 | also available `braintwister/ubuntu-20.04-tensorflow-2.0`. 271 | 272 | Start a plain container with 273 | 274 | ```bash 275 | docker run -it --runtime=nvidia braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0 276 | ``` 277 | 278 | [TensorBoard](https://www.tensorflow.org/guide/summaries_and_tensorboard) 279 | is available at `localhost:6006`, if `-p 6006:6006` was added to the `docker 280 | run` command and tensorboard was launched within the container. 281 | 282 | 283 | ### TensorFlow with Visual Studio Code 284 | 285 | To allow the container to use the host display, the command `xhost +local:` 286 | must be executed on the host before starting the container. 287 | 288 | ```bash 289 | docker run -d --runtime=nvidia -e DISPLAY \ 290 | braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0-vscode-1.62.3 291 | ``` 292 | 293 | 294 | ### TensorFlow with Jupyter 295 | 296 | Start the container with 297 | 298 | ```bash 299 | docker run --runtime=nvidia -p 8888:8888 \ 300 | braintwister/cuda-devel-11.4.2-tensorflow-gpu-2.0-jupyter-1.0 301 | ``` 302 | 303 | and open localhost:8888 on your host browser. 304 | 305 | -------------------------------------------------------------------------------- /alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM alpine:$VERSION 4 | 5 | LABEL maintainer="Bernd Doser " 6 | 7 | RUN apk add --no-cache \ 8 | curl \ 9 | git \ 10 | git-svn \ 11 | make \ 12 | ninja \ 13 | python3 \ 14 | python3-dev \ 15 | python3-pip \ 16 | python3-setuptools \ 17 | python3-tk \ 18 | vim \ 19 | wget 20 | 21 | RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 \ 22 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 23 | 24 | RUN pip install --upgrade pip \ 25 | && hash -r pip3 \ 26 | && pip install \ 27 | cmake==3.22.0 \ 28 | conan==1.43.0 \ 29 | pyyaml==5.4.1 30 | 31 | # Set aliases 32 | COPY aliases /tmp/ 33 | RUN cat /tmp/aliases >> /etc/bash.bashrc && rm -f /tmp/aliases 34 | 35 | ADD entrypoint.sh / 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | 38 | CMD ["/bin/bash"] 39 | -------------------------------------------------------------------------------- /alpine/aliases: -------------------------------------------------------------------------------- 1 | 2 | unalias -a 3 | 4 | alias ..='cd ..' 5 | alias ...='cd ../..' 6 | alias cp='cp -i' 7 | alias df='df -h' 8 | alias egrep='egrep --color=auto' 9 | alias fgrep='fgrep --color=auto' 10 | alias grep='grep --color=auto' 11 | alias l='ls -CF' 12 | alias la='ls -A' 13 | alias ll='ls -alF' 14 | alias ls='ls --color=auto' 15 | alias md='mkdir -p' 16 | alias mv='mv -i' 17 | alias rsync='rsync -avz -u -e ssh' 18 | alias tail='tail -fn1000' 19 | -------------------------------------------------------------------------------- /alpine/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" == "0" ] && [ "$USER_ID" != "0" ] 4 | then 5 | # Add local user 6 | USER_ID=${USER_ID:-9001} 7 | GROUP_ID=${GROUP_ID:-${USER_ID}} 8 | USER_NAME=${USER_NAME:-user} 9 | GROUP_NAME=${GROUP_NAME:-${USER_NAME}} 10 | 11 | groupadd -g $GROUP_ID $GROUP_NAME 12 | useradd -s /bin/bash -g $GROUP_ID -u $USER_ID -o -c "container user" -m $USER_NAME 13 | chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME 14 | 15 | export HOME=/home/$USER_NAME 16 | cd $HOME 17 | 18 | # Set python local user path 19 | export PATH=$PATH:/home/$USER_NAME/.local/bin 20 | 21 | # Git settings 22 | git config --global user.name "$GIT_USER_NAME" 23 | git config --global user.email "$GIT_USER_EMAIL" 24 | git config --global credential.helper 'cache --timeout=3600' 25 | 26 | # Conan settings 27 | chroot --userspec=$USER_NAME / 28 | conan remote add braintwister https://braintwister.jfrog.io/artifactory/api/conan/braintwister-conan 29 | 30 | # Execute entrypoint modules 31 | if [ -d "/entrypoint.d" ]; then 32 | for f in /entrypoint.d/*.sh; do 33 | . "$f" || break 34 | done 35 | fi 36 | 37 | # Execute cmd as user 38 | chroot --userspec=$USER_NAME --skip-chdir / "$@" 39 | else 40 | # Execute cmd as root 41 | $@ 42 | fi 43 | 44 | # Execute postprocess modules 45 | if [ -d "/postprocess.d" ]; then 46 | for f in /postprocess.d/*.sh; do 47 | . "$f" || break 48 | done 49 | fi 50 | -------------------------------------------------------------------------------- /build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | BrainTwister/docker-devel-env - Build list of docker images 5 | """ 6 | 7 | __author__ = "Bernd Doser" 8 | __email__ = "bernd.doser@braintwister.eu" 9 | __license__ = "MIT" 10 | 11 | import argparse 12 | import itertools 13 | import os 14 | import subprocess 15 | import sys 16 | import yaml 17 | 18 | IMAGE_VERSION = '0.6' 19 | 20 | def make_image_list(yaml_image_list): 21 | ''' Generate all combinations of modules and add base images ''' 22 | 23 | # Change single modules into list 24 | for e in yaml_image_list: 25 | for i, m in enumerate(e): 26 | if not isinstance(m, list): e[i] = [m] 27 | 28 | # Create base images 29 | for e in yaml_image_list: 30 | if len(e) > 1: yaml_image_list.append(e[:-1]) 31 | 32 | # Sort and remove duplicates 33 | yaml_image_list.sort() 34 | yaml_image_list = list(yaml_image_list for yaml_image_list,_ in itertools.groupby(yaml_image_list)) 35 | 36 | # Generate all combinations 37 | image_list = list() 38 | for e in yaml_image_list: 39 | image_list.extend(list(itertools.product(*e))) 40 | 41 | return image_list 42 | 43 | 44 | def build_images(image_list, args, docker_push): 45 | ''' Build and push images ''' 46 | 47 | build_status = [] 48 | for image in image_list: 49 | 50 | image_name = '-'.join(image) 51 | image_name_version = image_name + ':' + IMAGE_VERSION 52 | if args.verbose == 1: 53 | print(image_name_version.ljust(90), end='', flush=True) 54 | elif args.verbose > 1: 55 | print('Build ' + image_name_version) 56 | 57 | image_base_version = '-'.join(image[:-1]) + ':' + IMAGE_VERSION 58 | module = image[-1:][0] 59 | 60 | module_name, module_version = module.rsplit('-', 1) 61 | module_path = module 62 | if not os.path.isdir(module_path): 63 | module_path = module_name 64 | if not os.path.isdir(module_path): 65 | raise Exception("Wrong module_path") 66 | 67 | cmd = 'docker build' 68 | if args.pull: 69 | cmd += ' --pull' 70 | if args.no_cache: 71 | cmd += ' --no-cache' 72 | cmd += ' -t braintwister/' + image_name_version 73 | cmd += ' --build-arg VERSION=' + module_version 74 | if len(image) > 1: 75 | cmd += ' --build-arg BASE_IMAGE=braintwister/' + image_base_version 76 | cmd += ' .' 77 | 78 | if args.verbose > 1: 79 | print('Build command: ' + cmd) 80 | 81 | p = subprocess.Popen(cmd, shell=True, cwd=module_path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 82 | 83 | build_log = '' 84 | while p.poll() is None: 85 | line = p.stdout.readline().decode('ascii', 'backslashreplace') 86 | if args.verbose > 1: 87 | print(line, end='') 88 | else: 89 | build_log += line 90 | line = p.stdout.readline().decode('ascii', 'backslashreplace') 91 | if args.verbose > 1: 92 | print(line, end='') 93 | else: 94 | build_log += line 95 | 96 | if p.returncode == 0: 97 | build_status.append(True) 98 | if args.verbose == 1: 99 | print(' passed') 100 | elif args.verbose > 1: 101 | print('Build ' + image_name_version + ' successful') 102 | else: 103 | build_status.append(False) 104 | if args.verbose == 1: 105 | print(' failed') 106 | elif args.verbose > 1: 107 | print('Build ' + image_name_version + ' failed') 108 | print(build_log) 109 | continue 110 | 111 | # Push to DockerHub 112 | if docker_push == True: 113 | subprocess.run('docker push braintwister/' + image_name_version, 114 | shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 115 | 116 | # Tag latest version 117 | if args.latest: 118 | subprocess.run('docker tag braintwister/' + image_name_version + ' braintwister/' + image_name, 119 | shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 120 | if docker_push == True: 121 | subprocess.run('docker push braintwister/' + image_name, 122 | shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 123 | 124 | return build_status 125 | 126 | def main(): 127 | 128 | parser = argparse.ArgumentParser(description='Build list of docker images.') 129 | parser.add_argument('-i', '--images', default='images.yml', help='List of docker images to build (default: images.yml)') 130 | parser.add_argument('-v', '--verbose', action='count', default=0, help='Print more output (two levels)') 131 | parser.add_argument('-u', '--user', help='Username for docker repository') 132 | parser.add_argument('-p', '--password', help='Password for docker repository') 133 | parser.add_argument('--no-cache', action="store_true", help='Do not use cache when building the image') 134 | parser.add_argument('--pull', action="store_true", help='Always attempt to pull a newer version of the image') 135 | parser.add_argument('--latest', action="store_true", help='Tag the images as latest version') 136 | 137 | args = parser.parse_args() 138 | image_list = make_image_list(yaml.load(open(args.images, 'r'), Loader=yaml.FullLoader)); 139 | if args.verbose > 1: 140 | print('List of images to build:') 141 | for image in image_list: 142 | print('-'.join(image) + ':' + IMAGE_VERSION) 143 | print() 144 | 145 | docker_push = bool(args.user) and bool(args.password) 146 | 147 | # Log in to docker registry 148 | if docker_push == True: 149 | if args.verbose > 0: 150 | print('Login DockerHub') 151 | cmd = 'echo \'' + args.password + '\'' + ' | docker login -u ' + args.user + ' --password-stdin' 152 | subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 153 | 154 | build_status = build_images(image_list, args, docker_push) 155 | 156 | # Print build status 157 | if args.verbose > 1: 158 | print('Build status:') 159 | for image, status in zip(image_list, build_status): 160 | print('-'.join(image) + ':' + IMAGE_VERSION + ' %s' % status) 161 | print() 162 | print(str(build_status.count(True)) + ' of ' + str(len(build_status)) + ' images successfully built.') 163 | 164 | # Log out from docker registry 165 | if docker_push == True: 166 | if args.verbose > 0: 167 | print('Logout DockerHub') 168 | cmd = 'docker logout' 169 | subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 170 | 171 | if False in build_status: 172 | sys.exit(1) 173 | 174 | if __name__ == "__main__": 175 | main() 176 | 177 | -------------------------------------------------------------------------------- /clang/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \ 9 | && CODENAME=$(lsb_release -cs) \ 10 | && echo "deb http://apt.llvm.org/$CODENAME/ llvm-toolchain-$CODENAME-$VERSION main" >> /etc/apt/sources.list \ 11 | && echo "deb-src http://apt.llvm.org/$CODENAME/ llvm-toolchain-$CODENAME-$VERSION main" >> /etc/apt/sources.list \ 12 | && apt-get update \ 13 | && apt-get install -y --no-install-recommends \ 14 | clang-tidy \ 15 | clang-$VERSION \ 16 | clang-$VERSION-doc \ 17 | clang-format-$VERSION \ 18 | libclang-$VERSION-dev \ 19 | libclang-common-$VERSION-dev \ 20 | libclang1-$VERSION \ 21 | libfuzzer-$VERSION-dev \ 22 | libllvm$VERSION \ 23 | lld-$VERSION \ 24 | lldb-$VERSION \ 25 | llvm-$VERSION \ 26 | llvm-$VERSION-dev \ 27 | llvm-$VERSION-doc \ 28 | llvm-$VERSION-runtime 29 | 30 | RUN if [ "${VERSION%.*}" -gt "5" ] ; then \ 31 | apt-get install -y --no-install-recommends \ 32 | libc++-$VERSION-dev \ 33 | libc++abi-$VERSION-dev \ 34 | libomp-$VERSION-dev \ 35 | libllvm-$VERSION-ocaml-dev ; \ 36 | else \ 37 | apt-get install -y --no-install-recommends \ 38 | libomp-dev ; \ 39 | fi 40 | 41 | RUN if [ "${VERSION%.*}" -gt "7" ] ; then \ 42 | apt-get install -y --no-install-recommends \ 43 | clangd-$VERSION ; \ 44 | fi 45 | 46 | RUN if [ "${VERSION%.*}" -gt "9" ] ; then \ 47 | apt-get install -y --no-install-recommends \ 48 | python3-clang-$VERSION ; \ 49 | else \ 50 | apt-get install -y --no-install-recommends \ 51 | python-clang-$VERSION ; \ 52 | fi 53 | 54 | RUN apt-get clean \ 55 | && rm -rf /var/lib/apt/lists/* \ 56 | && update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$VERSION 100 \ 57 | && update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$VERSION 100 58 | 59 | ENV CC clang 60 | ENV CXX clang++ 61 | -------------------------------------------------------------------------------- /cmake/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | ARG ARCH="Linux-x86_64" 8 | 9 | RUN cd opt \ 10 | && wget -q https://cmake.org/files/v$MINOR_VERSION/cmake-$VERSION-$ARCH.tar.gz \ 11 | && tar xf cmake-$VERSION-$ARCH.tar.gz \ 12 | && rm cmake-$VERSION-$ARCH.tar.gz \ 13 | && ln -sf /opt/cmake-$VERSION-$ARCH/bin/ccmake /usr/bin/ccmake \ 14 | && ln -sf /opt/cmake-$VERSION-$ARCH/bin/cmake /usr/bin/cmake \ 15 | && ln -sf /opt/cmake-$VERSION-$ARCH/bin/cmake-gui /usr/bin/cmake-gui \ 16 | && ln -sf /opt/cmake-$VERSION-$ARCH/bin/cpack /usr/bin/cpack \ 17 | && ln -sf /opt/cmake-$VERSION-$ARCH/bin/ctest /usr/bin/ctest 18 | -------------------------------------------------------------------------------- /conan/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y --no-install-recommends \ 10 | python-setuptools \ 11 | && apt-get clean \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN pip3 install --upgrade pip \ 15 | && hash -r pip3 \ 16 | && pip3 install -I conan==$VERSION 17 | 18 | # Add entrypoint 19 | ADD conan_add_repositories.sh /entrypoint.d/ 20 | -------------------------------------------------------------------------------- /conan/conan_add_repositories.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add conan repositories of conan base module for eclipse user 4 | chroot --userspec=$USER_NAME / \ 5 | conan remote add braintwister https://braintwister.jfrog.io/artifactory/api/conan/braintwister-conan 6 | -------------------------------------------------------------------------------- /cuda-devel/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM nvidia/cuda:$VERSION-devel-ubuntu20.04 4 | 5 | LABEL maintainer="Bernd Doser " 6 | 7 | ARG TIMEZONE='Europe/Berlin' 8 | ARG DEBIAN_FRONTEND=noninteractive 9 | 10 | RUN echo $TIMEZONE > /etc/timezone && \ 11 | apt-get update && apt-get install -y tzdata && \ 12 | rm /etc/localtime && \ 13 | ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \ 14 | dpkg-reconfigure -f noninteractive tzdata && \ 15 | apt-get clean 16 | 17 | RUN apt-get update \ 18 | && apt-get install -y --no-install-recommends \ 19 | ca-certificates \ 20 | curl \ 21 | dirmngr \ 22 | git \ 23 | git-svn \ 24 | gpg-agent \ 25 | make \ 26 | ninja-build \ 27 | python3 \ 28 | python3-dev \ 29 | python3-pip \ 30 | python3-setuptools \ 31 | python3-tk \ 32 | software-properties-common \ 33 | sudo \ 34 | vim \ 35 | wget 36 | 37 | RUN if [ $(grep DISTRIB_RELEASE=18.04 /etc/lsb-release | wc -l) -eq 1 ]; then \ 38 | apt-get install -y --no-install-recommends \ 39 | libgbm-dev; \ 40 | fi 41 | 42 | RUN apt-get clean \ 43 | && rm -rf /var/lib/apt/lists/* 44 | 45 | RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 \ 46 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 47 | 48 | RUN pip install --upgrade pip \ 49 | && hash -r pip3 \ 50 | && pip install \ 51 | cmake==3.22.0 \ 52 | conan==1.43.0 \ 53 | pyyaml==5.4.1 54 | 55 | # Set aliases 56 | COPY aliases /tmp/ 57 | RUN cat /tmp/aliases >> /etc/bash.bashrc && rm -f /tmp/aliases 58 | 59 | ADD entrypoint.sh / 60 | ENTRYPOINT ["/entrypoint.sh"] 61 | 62 | CMD ["/bin/bash"] 63 | -------------------------------------------------------------------------------- /cuda-devel/aliases: -------------------------------------------------------------------------------- 1 | 2 | unalias -a 3 | 4 | alias ..='cd ..' 5 | alias ...='cd ../..' 6 | alias cp='cp -i' 7 | alias df='df -h' 8 | alias egrep='egrep --color=auto' 9 | alias fgrep='fgrep --color=auto' 10 | alias grep='grep --color=auto' 11 | alias l='ls -CF' 12 | alias la='ls -A' 13 | alias ll='ls -alF' 14 | alias ls='ls --color=auto' 15 | alias md='mkdir -p' 16 | alias mv='mv -i' 17 | alias rsync='rsync -avz -u -e ssh' 18 | alias tail='tail -fn1000' 19 | -------------------------------------------------------------------------------- /cuda-devel/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" == "0" ] && [ "$USER_ID" != "0" ] 4 | then 5 | # Add local user 6 | USER_ID=${USER_ID:-9001} 7 | GROUP_ID=${GROUP_ID:-${USER_ID}} 8 | USER_NAME=${USER_NAME:-user} 9 | GROUP_NAME=${GROUP_NAME:-${USER_NAME}} 10 | 11 | groupadd -g $GROUP_ID $GROUP_NAME 12 | useradd -s /bin/bash -g $GROUP_ID -u $USER_ID -o -c "container user" -m $USER_NAME 13 | chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME 14 | 15 | export HOME=/home/$USER_NAME 16 | cd $HOME 17 | 18 | # Set python local user path 19 | export PATH=$PATH:/home/$USER_NAME/.local/bin 20 | 21 | # Git settings 22 | git config --global user.name "$GIT_USER_NAME" 23 | git config --global user.email "$GIT_USER_EMAIL" 24 | git config --global credential.helper 'cache --timeout=3600' 25 | 26 | # Conan settings 27 | chroot --userspec=$USER_NAME / \ 28 | conan remote add braintwister https://braintwister.jfrog.io/artifactory/api/conan/braintwister-conan 29 | 30 | # Execute entrypoint modules 31 | if [ -d "/entrypoint.d" ]; then 32 | for f in /entrypoint.d/*.sh; do 33 | . "$f" || break 34 | done 35 | fi 36 | 37 | # Execute cmd as user 38 | chroot --userspec=$USER_NAME --skip-chdir / "$@" 39 | else 40 | # Execute cmd as root 41 | $@ 42 | fi 43 | 44 | # Execute postprocess modules 45 | if [ -d "/postprocess.d" ]; then 46 | for f in /postprocess.d/*.sh; do 47 | . "$f" || break 48 | done 49 | fi 50 | -------------------------------------------------------------------------------- /cuda-runtime/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM nvidia/cuda:$VERSION-runtime-ubuntu20.04 4 | 5 | LABEL maintainer="Bernd Doser " 6 | 7 | ARG TIMEZONE='Europe/Berlin' 8 | ARG DEBIAN_FRONTEND=noninteractive 9 | 10 | RUN echo $TIMEZONE > /etc/timezone && \ 11 | apt-get update && apt-get install -y tzdata && \ 12 | rm /etc/localtime && \ 13 | ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \ 14 | dpkg-reconfigure -f noninteractive tzdata && \ 15 | apt-get clean 16 | 17 | RUN apt-get update \ 18 | && apt-get install -y --no-install-recommends \ 19 | ca-certificates \ 20 | curl \ 21 | dirmngr \ 22 | git \ 23 | git-svn \ 24 | gpg-agent \ 25 | make \ 26 | ninja-build \ 27 | python3 \ 28 | python3-dev \ 29 | python3-pip \ 30 | python3-setuptools \ 31 | python3-tk \ 32 | software-properties-common \ 33 | sudo \ 34 | vim \ 35 | wget 36 | 37 | RUN if [ $(grep DISTRIB_RELEASE=18.04 /etc/lsb-release | wc -l) -eq 1 ]; then \ 38 | apt-get install -y --no-install-recommends \ 39 | libgbm-dev; \ 40 | fi 41 | 42 | RUN apt-get clean \ 43 | && rm -rf /var/lib/apt/lists/* 44 | 45 | RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 \ 46 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 47 | 48 | RUN pip install --upgrade pip \ 49 | && hash -r pip3 \ 50 | && pip install \ 51 | cmake==3.22.0 \ 52 | conan==1.43.0 \ 53 | pyyaml==5.4.1 54 | 55 | # Set aliases 56 | COPY aliases /tmp/ 57 | RUN cat /tmp/aliases >> /etc/bash.bashrc && rm -f /tmp/aliases 58 | 59 | ADD entrypoint.sh / 60 | ENTRYPOINT ["/entrypoint.sh"] 61 | 62 | CMD ["/bin/bash"] 63 | -------------------------------------------------------------------------------- /cuda-runtime/aliases: -------------------------------------------------------------------------------- 1 | 2 | unalias -a 3 | 4 | alias ..='cd ..' 5 | alias ...='cd ../..' 6 | alias cp='cp -i' 7 | alias df='df -h' 8 | alias egrep='egrep --color=auto' 9 | alias fgrep='fgrep --color=auto' 10 | alias grep='grep --color=auto' 11 | alias l='ls -CF' 12 | alias la='ls -A' 13 | alias ll='ls -alF' 14 | alias ls='ls --color=auto' 15 | alias md='mkdir -p' 16 | alias mv='mv -i' 17 | alias rsync='rsync -avz -u -e ssh' 18 | alias tail='tail -fn1000' 19 | -------------------------------------------------------------------------------- /cuda-runtime/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" == "0" ] && [ "$USER_ID" != "0" ] 4 | then 5 | # Add local user 6 | USER_ID=${USER_ID:-9001} 7 | GROUP_ID=${GROUP_ID:-${USER_ID}} 8 | USER_NAME=${USER_NAME:-user} 9 | GROUP_NAME=${GROUP_NAME:-${USER_NAME}} 10 | 11 | groupadd -g $GROUP_ID $GROUP_NAME 12 | useradd -s /bin/bash -g $GROUP_ID -u $USER_ID -o -c "container user" -m $USER_NAME 13 | chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME 14 | 15 | export HOME=/home/$USER_NAME 16 | cd $HOME 17 | 18 | # Set python local user path 19 | export PATH=$PATH:/home/$USER_NAME/.local/bin 20 | 21 | # Git settings 22 | git config --global user.name "$GIT_USER_NAME" 23 | git config --global user.email "$GIT_USER_EMAIL" 24 | git config --global credential.helper 'cache --timeout=3600' 25 | 26 | # Conan settings 27 | chroot --userspec=$USER_NAME / \ 28 | conan remote add braintwister https://braintwister.jfrog.io/artifactory/api/conan/braintwister-conan 29 | 30 | # Execute entrypoint modules 31 | if [ -d "/entrypoint.d" ]; then 32 | for f in /entrypoint.d/*.sh; do 33 | . "$f" || break 34 | done 35 | fi 36 | 37 | # Execute cmd as user 38 | chroot --userspec=$USER_NAME --skip-chdir / "$@" 39 | else 40 | # Execute cmd as root 41 | $@ 42 | fi 43 | 44 | # Execute postprocess modules 45 | if [ -d "/postprocess.d" ]; then 46 | for f in /postprocess.d/*.sh; do 47 | . "$f" || break 48 | done 49 | fi 50 | -------------------------------------------------------------------------------- /docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2.3" 2 | services: 3 | 4 | vscode: 5 | image: braintwister/cuda-devel-11.4.2-gcc-9-clang-9-vscode-1.60.2:0.5 6 | runtime: nvidia 7 | volumes: 8 | - /etc/localtime:/etc/localtime:ro 9 | - /tmp/.X11-unix:/tmp/.X11-unix:ro 10 | - home:/home/${USER_NAME} 11 | - ${GIT_DIR}:/home/${USER_NAME}/git 12 | - ${DATA_DIR}:/home/${USER_NAME}/data:ro 13 | environment: 14 | - DISPLAY 15 | - USER_ID=${USER_ID} 16 | - GROUP_ID=${GROUP_ID} 17 | - USER_NAME=${USER_NAME} 18 | - GROUP_NAME=${GROUP_NAME} 19 | network_mode: host 20 | privileged: true 21 | 22 | volumes: 23 | home: 24 | 25 | -------------------------------------------------------------------------------- /docker-nightly/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | RUN apt-get update \ 7 | && apt-get install -y \ 8 | apt-transport-https \ 9 | && apt-get clean \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 13 | 14 | RUN add-apt-repository \ 15 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ 16 | $(lsb_release -cs) \ 17 | nightly" 18 | 19 | RUN apt-get update \ 20 | && apt-get install -y \ 21 | docker-ce \ 22 | && apt-get clean \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | ADD add_user_to_docker_group.sh /entrypoint.d/ 26 | -------------------------------------------------------------------------------- /docker-nightly/add_user_to_docker_group.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin 2 | 3 | # Add user to docker group and start service 4 | usermod -aG docker $USER_NAME 5 | start-stop-daemon -SbCv -x /usr/bin/dockerd -- -H unix:// 6 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y \ 10 | apt-transport-https \ 11 | && apt-get clean \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - 15 | 16 | RUN add-apt-repository \ 17 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ 18 | $(lsb_release -cs) \ 19 | stable" 20 | 21 | RUN apt-get update \ 22 | && apt-get install -y \ 23 | docker-ce=5:$VERSION.* \ 24 | && apt-get clean \ 25 | && rm -rf /var/lib/apt/lists/* 26 | 27 | ADD add_user_to_docker_group.sh /entrypoint.d/ 28 | -------------------------------------------------------------------------------- /docker/add_user_to_docker_group.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin 2 | 3 | # Add user to docker group and start service 4 | usermod -aG docker $USER_NAME 5 | start-stop-daemon -SbCv -x /usr/bin/dockerd -- -H unix:// 6 | -------------------------------------------------------------------------------- /doxygen/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y \ 10 | ghostscript \ 11 | graphviz \ 12 | mscgen \ 13 | texlive \ 14 | texlive-lang-english \ 15 | texlive-latex-extra \ 16 | && apt-get clean \ 17 | && rm -rf /var/lib/apt/lists/* 18 | 19 | RUN wget -q https://sourceforge.net/projects/doxygen/files/rel-$VERSION/doxygen-$VERSION.linux.bin.tar.gz \ 20 | && tar xf doxygen-$VERSION.linux.bin.tar.gz \ 21 | && rm doxygen-$VERSION.linux.bin.tar.gz \ 22 | && mv doxygen-$VERSION /opt \ 23 | && ln -sf /opt/doxygen-$VERSION/bin/doxygen /usr/bin/doxygen 24 | -------------------------------------------------------------------------------- /eclipse-cpp/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y --no-install-recommends \ 10 | firefox \ 11 | libgtk-3-0 \ 12 | openjdk-11-jdk \ 13 | && apt-get clean \ 14 | && rm -rf /var/lib/apt/lists/* 15 | 16 | ENV INSTALLATION_DIR /usr/local 17 | 18 | # Needed for string substitution 19 | SHELL ["/bin/bash", "-c"] 20 | RUN curl -L http://download.eclipse.org/technology/epp/downloads/release/${VERSION/./-}/R/eclipse-cpp-${VERSION/./-}-R-linux-gtk-x86_64.tar.gz | tar xz -C $INSTALLATION_DIR 21 | 22 | # Install plugins 23 | ADD install_plugins.py plugins-$VERSION.yml /config/ 24 | RUN /config/install_plugins.py -p /config/plugins-$VERSION.yml 25 | 26 | ADD entrypoint_eclipse.sh /entrypoint.d/ 27 | 28 | CMD "$INSTALLATION_DIR/eclipse/eclipse" 29 | -------------------------------------------------------------------------------- /eclipse-cpp/entrypoint_eclipse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Give permission to access /dev/tty* 4 | usermod -a -G dialout $USER_NAME 5 | 6 | # Set user as owner of eclipse installation directory to allow updates of plugins 7 | chown -R $USER_NAME:$GROUP_NAME $INSTALLATION_DIR/eclipse 8 | -------------------------------------------------------------------------------- /eclipse-cpp/install_plugins.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import argparse 4 | import subprocess 5 | import yaml 6 | 7 | parser = argparse.ArgumentParser(description='Install eclipse plugins.') 8 | parser.add_argument('-p, --plugins', dest='plugins', default='plugins.yml', 9 | help='List of plugins to install (default: plugins.yml)') 10 | 11 | args = parser.parse_args() 12 | plugins = yaml.load(open(args.plugins, 'r'), Loader=yaml.FullLoader) or {}; 13 | 14 | # Uninstall plugins 15 | if 'unistall' in plugins: 16 | cmd = '$INSTALLATION_DIR/eclipse/eclipse -noSplash -clean -purgeHistory' \ 17 | + ' -application org.eclipse.equinox.p2.director -destination $INSTALLATION_DIR/eclipse' \ 18 | + ' -uninstallIU ' + ','.join(plugins['uninstall']) \ 19 | 20 | subprocess.run(cmd, shell=True, check=True) 21 | 22 | # Install plugins 23 | if 'install' in plugins: 24 | for plugin_name, feature_group in plugins['install'].items(): 25 | print('Install ', plugin_name) 26 | for features in feature_group: 27 | cmd = '$INSTALLATION_DIR/eclipse/eclipse -noSplash -clean -purgeHistory' \ 28 | + ' -application org.eclipse.equinox.p2.director -destination $INSTALLATION_DIR/eclipse' \ 29 | + ' -repository ' + ','.join(plugins['general_repos']) + ',' + ','.join(features['repos']) \ 30 | + ' -installIU ' + ','.join(features['units']) \ 31 | + ' -vmargs -Dorg.eclipse.equinox.p2.transport.ecf.retry=5 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=10000' 32 | 33 | subprocess.run(cmd, shell=True, check=True) 34 | -------------------------------------------------------------------------------- /eclipse-cpp/plugins-2020.09.yml: -------------------------------------------------------------------------------- 1 | --- 2 | general_repos: 3 | - http://download.eclipse.org/releases/2020-09/ 4 | 5 | install: 6 | BashEditor: 7 | - repos: 8 | - https://dl.bintray.com/de-jcup/basheditor/ 9 | units: 10 | - de.jcup.basheditor.feature.group 11 | 12 | cmake4eclipse: 13 | - repos: 14 | - https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ 15 | units: 16 | - de.marw.cdt.cmake.feature.group 17 | 18 | cmakeed: 19 | - repos: 20 | - https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/ 21 | units: 22 | - com.cthing.cmakeed.feature.feature.group 23 | 24 | JenkinsEditor: 25 | - repos: 26 | - https://dl.bintray.com/de-jcup/jenkinseditor/ 27 | units: 28 | - de.jcup.jenkinseditor.feature.feature.group 29 | 30 | JSONEditor: 31 | - repos: 32 | - https://sourceforge.net/projects/eclipsejsonedit/files/update/ 33 | units: 34 | - jsonedit-feature.feature.group 35 | 36 | PyDev: 37 | - repos: 38 | - http://www.pydev.org/updates/ 39 | units: 40 | - org.python.pydev.feature.feature.group 41 | -------------------------------------------------------------------------------- /eclipse-cpp/plugins-2021.03.yml: -------------------------------------------------------------------------------- 1 | --- 2 | general_repos: 3 | - http://download.eclipse.org/releases/2021-03/ 4 | 5 | install: 6 | cmake4eclipse: 7 | - repos: 8 | - https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ 9 | units: 10 | - de.marw.cdt.cmake.feature.group 11 | 12 | cmakeed: 13 | - repos: 14 | - https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/ 15 | units: 16 | - com.cthing.cmakeed.feature.feature.group 17 | 18 | JSONEditor: 19 | - repos: 20 | - https://sourceforge.net/projects/eclipsejsonedit/files/update/ 21 | units: 22 | - jsonedit-feature.feature.group 23 | 24 | PyDev: 25 | - repos: 26 | - http://www.pydev.org/updates/ 27 | units: 28 | - org.python.pydev.feature.feature.group 29 | -------------------------------------------------------------------------------- /eclipse-cpp/plugins-2021.06.yml: -------------------------------------------------------------------------------- 1 | --- 2 | general_repos: 3 | - http://download.eclipse.org/releases/2021-06/ 4 | 5 | install: 6 | cmake4eclipse: 7 | - repos: 8 | - https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ 9 | units: 10 | - de.marw.cdt.cmake.feature.group 11 | 12 | cmakeed: 13 | - repos: 14 | - https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/ 15 | units: 16 | - com.cthing.cmakeed.feature.feature.group 17 | 18 | JSONEditor: 19 | - repos: 20 | - https://sourceforge.net/projects/eclipsejsonedit/files/update/ 21 | units: 22 | - jsonedit-feature.feature.group 23 | 24 | PyDev: 25 | - repos: 26 | - http://www.pydev.org/updates/ 27 | units: 28 | - org.python.pydev.feature.feature.group 29 | -------------------------------------------------------------------------------- /eclipse-cpp/plugins-2021.09.yml: -------------------------------------------------------------------------------- 1 | --- 2 | general_repos: 3 | - http://download.eclipse.org/releases/2021-09/ 4 | 5 | install: 6 | cmake4eclipse: 7 | - repos: 8 | - https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ 9 | units: 10 | - de.marw.cdt.cmake.feature.group 11 | 12 | cmakeed: 13 | - repos: 14 | - https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/ 15 | units: 16 | - com.cthing.cmakeed.feature.feature.group 17 | 18 | JSONEditor: 19 | - repos: 20 | - https://sourceforge.net/projects/eclipsejsonedit/files/update/ 21 | units: 22 | - jsonedit-feature.feature.group 23 | 24 | PyDev: 25 | - repos: 26 | - http://www.pydev.org/updates/ 27 | units: 28 | - org.python.pydev.feature.feature.group 29 | -------------------------------------------------------------------------------- /gcc/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-add-repository -y ppa:ubuntu-toolchain-r/test \ 9 | && apt-get update \ 10 | && apt-get install -y --no-install-recommends \ 11 | gcc-$VERSION \ 12 | g++-$VERSION \ 13 | gdb \ 14 | linux-tools-generic \ 15 | && apt-get clean \ 16 | && rm -rf /var/lib/apt/lists/* \ 17 | && ln -sf /usr/bin/g++-$VERSION /usr/bin/g++ \ 18 | && ln -sf /usr/bin/gcc-$VERSION /usr/bin/gcc 19 | 20 | ENV CC gcc 21 | ENV CXX g++ 22 | -------------------------------------------------------------------------------- /gcovr/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN pip3 install -I gcovr~=$VERSION 9 | -------------------------------------------------------------------------------- /gitg/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y --no-install-recommends \ 10 | gitg=$VERSION \ 11 | && apt-get clean \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | -------------------------------------------------------------------------------- /gtest/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | WORKDIR /tmp 9 | 10 | RUN wget -q https://github.com/google/googletest/archive/release-$VERSION.tar.gz \ 11 | && tar xf release-$VERSION.tar.gz \ 12 | && rm release-$VERSION.tar.gz \ 13 | && cd googletest-release-$VERSION \ 14 | && mkdir build \ 15 | && cd build \ 16 | && cmake -DCMAKE_INSTALL_PREFIX=/opt/googletest-$VERSION .. \ 17 | && make -j \ 18 | && make install \ 19 | && rm -r /tmp/googletest-release-$VERSION 20 | 21 | WORKDIR / 22 | 23 | ENV GTEST_ROOT /opt/googletest-$VERSION 24 | -------------------------------------------------------------------------------- /images.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - ['ubuntu-20.04', ['gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11', 'clang-9', 'clang-10', 'clang-11', 'clang-12']] 3 | - ['ubuntu-20.04', ['gcc-11', 'clang-12'], ['eclipse-cpp-2021.09', 'vscode-1.62.3']] 4 | - ['ubuntu-20.04', 'gcc-11', 'clang-12', 'vscode-1.62.3'] 5 | 6 | - ['cuda-devel-11.4.2', ['gcc-7', 'gcc-8', 'gcc-9', 'gcc-10', 'gcc-11', 'clang-9', 'clang-10', 'clang-11', 'clang-12']] 7 | - ['cuda-devel-11.4.2', ['gcc-9', 'clang-9'], ['eclipse-cpp-2021.09', 'vscode-1.62.3']] 8 | - ['cuda-devel-11.4.2', 'gcc-9', 'clang-9', 'vscode-1.62.3'] 9 | - ['cuda-devel-11.4.2', 'gcc-8', 'clang-9', 'doxygen-1.8.5', 'vscode-1.62.3'] 10 | - ['cuda-devel-11.4.2', 'gcc-8', 'doxygen-1.8.13'] 11 | 12 | - ['ubuntu-20.04', 'docker-20.10'] 13 | - ['ubuntu-20.04', 'docker-19.03'] 14 | - ['ubuntu-18.04', 'docker-18.09'] 15 | -------------------------------------------------------------------------------- /jupyter/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN pip3 install --upgrade pip \ 9 | && hash -r pip3 \ 10 | && pip3 install -I \ 11 | jupyter~=$VERSION 12 | 13 | # Set up notebook config 14 | COPY jupyter_notebook_config.py /jupyter-config/ 15 | ENV JUPYTER_CONFIG_DIR /jupyter-config 16 | 17 | EXPOSE 8888 18 | 19 | CMD ["bash", "-c", "source /etc/bash.bashrc && jupyter notebook --ip 0.0.0.0 --no-browser --allow-root"] 20 | -------------------------------------------------------------------------------- /jupyter/jupyter_notebook_config.py: -------------------------------------------------------------------------------- 1 | c.NotebookApp.custom_display_url = 'http://localhost:8888' 2 | -------------------------------------------------------------------------------- /lcov/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN wget -q https://github.com/linux-test-project/lcov/archive/v$VERSION.tar.gz && \ 9 | tar xf v$VERSION.tar.gz && \ 10 | rm v$VERSION.tar.gz && \ 11 | cd lcov-$VERSION && \ 12 | make install && \ 13 | cd .. && \ 14 | rm -r lcov-$VERSION 15 | -------------------------------------------------------------------------------- /nsight/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | RUN apt-get update \ 7 | && apt-get install -y --no-install-recommends \ 8 | firefox \ 9 | libgtk2.0-0 10 | 11 | RUN if [ $(grep DISTRIB_RELEASE=16.04 /etc/lsb-release | wc -l) -eq 1 ]; then \ 12 | apt-get install -y --no-install-recommends \ 13 | openjdk-8-jdk; \ 14 | fi 15 | 16 | RUN if [ $(grep DISTRIB_RELEASE=18.04 /etc/lsb-release | wc -l) -eq 1 ]; then \ 17 | apt-get install -y --no-install-recommends \ 18 | openjdk-11-jdk; \ 19 | fi 20 | 21 | RUN apt-get clean \ 22 | && rm -rf /var/lib/apt/lists/* 23 | 24 | # Install plugins 25 | ADD install_plugins.py plugins.yml /config/ 26 | RUN /config/install_plugins.py -p /config/plugins.yml 27 | 28 | CMD "/usr/local/cuda/bin/nsight" 29 | -------------------------------------------------------------------------------- /nsight/install_plugins.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import argparse 4 | import subprocess 5 | import yaml 6 | 7 | parser = argparse.ArgumentParser(description='Install eclipse plugins.') 8 | parser.add_argument('-p, --plugins', dest='plugins', default='plugins.yml', 9 | help='List of plugins to install (default: plugins.yml)') 10 | 11 | args = parser.parse_args() 12 | plugins = yaml.load(open(args.plugins, 'r')) or {}; 13 | 14 | # Uninstall plugins 15 | if 'unistall' in plugins: 16 | cmd = '/usr/local/cuda/bin/nsight -noSplash -clean -purgeHistory' \ 17 | + ' -application org.eclipse.equinox.p2.director -destination /usr/local/cuda/libnsight' \ 18 | + ' -uninstallIU ' + ','.join(plugins['uninstall']) \ 19 | 20 | subprocess.run(cmd, shell=True, check=True) 21 | 22 | # Install plugins 23 | if 'install' in plugins: 24 | for plugin_name, feature_group in plugins['install'].items(): 25 | print('Install ', plugin_name) 26 | for features in feature_group: 27 | cmd = '/usr/local/cuda/bin/nsight -noSplash -clean -purgeHistory' \ 28 | + ' -application org.eclipse.equinox.p2.director -destination /usr/local/cuda/libnsight' \ 29 | + ' -repository ' + ','.join(plugins['general_repos']) + ',' + ','.join(features['repos']) \ 30 | + ' -installIU ' + ','.join(features['units']) \ 31 | + ' -vmargs -Dorg.eclipse.equinox.p2.transport.ecf.retry=5 -Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=10000' 32 | 33 | subprocess.run(cmd, shell=True, check=True) 34 | -------------------------------------------------------------------------------- /nsight/plugins.yml: -------------------------------------------------------------------------------- 1 | --- 2 | general_repos: 3 | - http://download.eclipse.org/releases/juno/ 4 | 5 | install: 6 | cmake4eclipse: 7 | - repos: 8 | - https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/ 9 | units: 10 | - de.marw.cdt.cmake.feature.group 11 | 12 | cmakeed: 13 | - repos: 14 | - https://raw.githubusercontent.com/15knots/cmakeed/master/cmakeed-update/ 15 | units: 16 | - com.cthing.cmakeed.feature.feature.group 17 | 18 | # PyDev: 19 | # - repos: 20 | # - http://www.pydev.org/updates/ 21 | # units: 22 | # - org.python.pydev.feature.feature.group 23 | -------------------------------------------------------------------------------- /nvtop/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y --no-install-recommends \ 10 | libncurses5-dev \ 11 | && apt-get clean \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN cd opt && \ 15 | wget -q https://github.com/Syllo/nvtop/archive/$VERSION.tar.gz && \ 16 | tar xf $VERSION.tar.gz && \ 17 | rm $VERSION.tar.gz && \ 18 | mkdir -p nvtop-$VERSION/build && \ 19 | cd nvtop-$VERSION/build && \ 20 | cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True && \ 21 | make && \ 22 | make install 23 | -------------------------------------------------------------------------------- /softwipe/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN pip install \ 9 | numpy \ 10 | scipy 11 | 12 | RUN apt-get update \ 13 | && git clone https://github.com/adrianzap/softwipe.git \ 14 | && cd softwipe \ 15 | && git checkout $VERSION \ 16 | && yes Y | ./softwipe.py \ 17 | && apt-get clean \ 18 | && rm -rf /var/lib/apt/lists/* 19 | -------------------------------------------------------------------------------- /tensorflow-gpu/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | RUN ln -snf /usr/bin/python3 /usr/bin/python 9 | 10 | RUN apt-get update \ 11 | && apt-get install -y \ 12 | python3-tk \ 13 | unzip \ 14 | && apt-get clean \ 15 | && rm -rf /var/lib/apt/lists/* 16 | 17 | RUN pip install \ 18 | graphviz \ 19 | matplotlib \ 20 | mock \ 21 | numpy \ 22 | pydot \ 23 | seaborn \ 24 | setuptools \ 25 | six \ 26 | sklearn \ 27 | stn \ 28 | wheel 29 | 30 | RUN pip install --no-deps \ 31 | keras_applications==1.0.6 \ 32 | keras_preprocessing==1.0.5 33 | 34 | ARG BAZEL_VERSION=3.4.1 35 | RUN wget -q https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh \ 36 | && chmod +x bazel-$BAZEL_VERSION-installer-linux-x86_64.sh \ 37 | && ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh 38 | 39 | SHELL ["/bin/bash", "-c"] 40 | RUN source /usr/local/lib/bazel/bin/bazel-complete.bash 41 | 42 | ENV TF_NEED_CUDA=1 43 | # TF_CUDA_VERSION=${CUDA_VERSION%.*} \ 44 | # TF_CUDNN_VERSION=${CUDNN_VERSION%.*.*} 45 | 46 | # Hack to find cuda libraries 47 | RUN ln -s /usr/lib/x86_64-linux-gnu/libcublas.so.10 /usr/local/cuda/lib64/libcublas.so.10 48 | 49 | RUN git clone https://github.com/tensorflow/tensorflow \ 50 | && cd tensorflow \ 51 | && git checkout v$VERSION \ 52 | && ./configure \ 53 | && bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package \ 54 | && ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg \ 55 | && pip install /tmp/tensorflow_pkg/tensorflow-$VERSION-cp36-cp36m-linux_x86_64.whl \ 56 | && rm -r /tensorflow /tmp/tensorflow_pkg /bazel-0.25.2-installer-linux-x86_64.sh /root/.cache/bazel 57 | -------------------------------------------------------------------------------- /ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VERSION 2 | 3 | FROM ubuntu:$VERSION 4 | 5 | LABEL maintainer="Bernd Doser " 6 | 7 | ARG TIMEZONE='Europe/Berlin' 8 | ARG DEBIAN_FRONTEND=noninteractive 9 | 10 | RUN echo $TIMEZONE > /etc/timezone && \ 11 | apt-get update && apt-get install -y tzdata && \ 12 | rm /etc/localtime && \ 13 | ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \ 14 | dpkg-reconfigure -f noninteractive tzdata && \ 15 | apt-get clean 16 | 17 | RUN apt-get update \ 18 | && apt-get install -y --no-install-recommends \ 19 | ca-certificates \ 20 | curl \ 21 | dirmngr \ 22 | git \ 23 | git-svn \ 24 | gpg-agent \ 25 | make \ 26 | ninja-build \ 27 | python3 \ 28 | python3-dev \ 29 | python3-pip \ 30 | python3-setuptools \ 31 | python3-tk \ 32 | software-properties-common \ 33 | sudo \ 34 | vim \ 35 | wget 36 | 37 | RUN if [ $(grep DISTRIB_RELEASE=18.04 /etc/lsb-release | wc -l) -eq 1 ]; then \ 38 | apt-get install -y --no-install-recommends \ 39 | libgbm-dev; \ 40 | fi 41 | 42 | RUN apt-get clean \ 43 | && rm -rf /var/lib/apt/lists/* 44 | 45 | RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 \ 46 | && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 47 | 48 | RUN pip install --upgrade pip \ 49 | && hash -r pip3 \ 50 | && pip install \ 51 | cmake==3.22.0 \ 52 | conan==1.43.0 \ 53 | pyyaml==5.4.1 54 | 55 | # Set aliases 56 | COPY aliases /tmp/ 57 | RUN cat /tmp/aliases >> /etc/bash.bashrc && rm -f /tmp/aliases 58 | 59 | ADD entrypoint.sh / 60 | ENTRYPOINT ["/entrypoint.sh"] 61 | 62 | CMD ["/bin/bash"] 63 | -------------------------------------------------------------------------------- /ubuntu/aliases: -------------------------------------------------------------------------------- 1 | 2 | unalias -a 3 | 4 | alias ..='cd ..' 5 | alias ...='cd ../..' 6 | alias cp='cp -i' 7 | alias df='df -h' 8 | alias egrep='egrep --color=auto' 9 | alias fgrep='fgrep --color=auto' 10 | alias grep='grep --color=auto' 11 | alias l='ls -CF' 12 | alias la='ls -A' 13 | alias ll='ls -alF' 14 | alias ls='ls --color=auto' 15 | alias md='mkdir -p' 16 | alias mv='mv -i' 17 | alias rsync='rsync -avz -u -e ssh' 18 | alias tail='tail -fn1000' 19 | -------------------------------------------------------------------------------- /ubuntu/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EUID" == "0" ] && [ "$USER_ID" != "0" ] 4 | then 5 | # Add local user 6 | USER_ID=${USER_ID:-9001} 7 | GROUP_ID=${GROUP_ID:-${USER_ID}} 8 | USER_NAME=${USER_NAME:-user} 9 | GROUP_NAME=${GROUP_NAME:-${USER_NAME}} 10 | 11 | groupadd -g $GROUP_ID $GROUP_NAME 12 | useradd -s /bin/bash -g $GROUP_ID -u $USER_ID -o -c "container user" -m $USER_NAME 13 | chown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME 14 | 15 | export HOME=/home/$USER_NAME 16 | cd $HOME 17 | 18 | # Set python local user path 19 | export PATH=$PATH:/home/$USER_NAME/.local/bin 20 | 21 | # Git settings 22 | git config --global user.name "$GIT_USER_NAME" 23 | git config --global user.email "$GIT_USER_EMAIL" 24 | git config --global credential.helper 'cache --timeout=3600' 25 | 26 | # Conan settings 27 | chroot --userspec=$USER_NAME / \ 28 | conan remote add braintwister https://braintwister.jfrog.io/artifactory/api/conan/braintwister-conan 29 | 30 | # Execute entrypoint modules 31 | if [ -d "/entrypoint.d" ]; then 32 | for f in /entrypoint.d/*.sh; do 33 | . "$f" || break 34 | done 35 | fi 36 | 37 | # Execute cmd as user 38 | chroot --userspec=$USER_NAME --skip-chdir / "$@" 39 | else 40 | # Execute cmd as root 41 | $@ 42 | fi 43 | 44 | # Execute postprocess modules 45 | if [ -d "/postprocess.d" ]; then 46 | for f in /postprocess.d/*.sh; do 47 | . "$f" || break 48 | done 49 | fi 50 | -------------------------------------------------------------------------------- /vscode/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE_IMAGE 2 | FROM $BASE_IMAGE 3 | 4 | LABEL maintainer="Bernd Doser " 5 | 6 | ARG VERSION 7 | 8 | ENV SHELL /bin/bash 9 | ENV DOWNLOAD_URL https://update.code.visualstudio.com/$VERSION/linux-deb-x64/stable 10 | 11 | RUN wget -q "$DOWNLOAD_URL" -O code.deb 12 | 13 | RUN apt-get update \ 14 | && apt-get install -y \ 15 | firefox \ 16 | libdrm2 \ 17 | libgbm1 \ 18 | libxcb-dri3-0 \ 19 | libxshmfence-dev \ 20 | ./code.deb \ 21 | && apt-get clean \ 22 | && rm ./code.deb \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | ADD keep_running.sh /postprocess.d/ 26 | 27 | CMD ["code", "--no-xshm"] 28 | -------------------------------------------------------------------------------- /vscode/keep_running.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Keep container running until detatched vscode processes are terminated 4 | for i in $(pidof code) 5 | do 6 | while [ -e /proc/$i ] 7 | do sleep 0.1 8 | done 9 | done 10 | --------------------------------------------------------------------------------