Skip to content

Instantly share code, notes, and snippets.

@kiyoon
Last active February 7, 2020 19:29
Show Gist options
  • Save kiyoon/8040324833e47b328cb987c562257afa to your computer and use it in GitHub Desktop.
Save kiyoon/8040324833e47b328cb987c562257afa to your computer and use it in GitHub Desktop.
Sample docker-compose file
#docker-compose.yml : Make container as described here.
#Author : Hyeonsu Lyu, hslyu@unist.ac.kr, +82 10-5117-9780
# Kiyoon Kim (kiyoon.kim@ed.ac.uk)
#First version, Jan. 30, 2019
version: '2'
services:
aislab-docker:
container_name: base_env
image: kiyoon/docker-for-ML:cuda10.1-cudnn7
user: "$UID:$UID" # Assuming GID is the same as UID
#runtime: runc
gpus: all
restart: on-failure
# Host network mode adds a container on the host's network stack.
# network_mode: "host"
# Bridge network mode connects the container and the host network with declared port
network_mode: "bridge"
# ports:
# - "6666:6666/tcp"
# - "8888:8888/tcp"
volumes:
- /disk/scratch1/$USER:/scratch1
- $HOME/project:/project
#- $HOME/Downloads/aislab-tf/cuda:/cuda
- $HOME/.vimrc:/home/docker$UID/.vimrc
- $HOME/.screenrc:/home/docker$UID/.screenrc
- $HOME/.Xauthority:/home/docker$UID/.Xauthority
- $HOME/.ssh:/home/docker$UID/.ssh # for allowing git to use ssh protocol
- $HOME/.gitconfig:/home/docker$UID/.gitconfig
# - /tmp/.X11-unix:/tmp/.X11-unix
environment:
# - TZ=Asia/Seoul
# - NVIDIA_VISIBLE_DEVICES=all
# - DISPLAY=$DISPLAY
# - LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64
# - PATH=/usr/local/cuda-9.0/bin
stdin_open: true
tty: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment