How to build and run Intel Chainer Docker image
This document describes how to build and run Intel Chainer Docker image.
We provide the Docker image for Ubuntu and Centos based on python2 and python3, respectively. To run Intel Chainer Docker Image as a container, login to the environment with one of the following command support you prefer.
-
Python2-ubuntu
$ docker pull chainer/chainer:latest-intel-python2-ubuntu
-
Python2-centos
$ docker pull chainer/chainer: latest-intel-python2-centos
-
Python3-ubuntu
$ docker pull chainer/chainer:latest-intel-python3-ubuntu
-
Python3-centos
$ docker pull chainer/chainer:latest-intel-python3-centos
This cmd will download the Intel Chainer docker image from docker hub web. Please note this one may be not the latest version in the master of Intel Chainer github repo.
We also provide the Dockerfile for Ubuntu and Centos in chainer/docker directory based on python2 and python3, respectively. Take python2 as an example, detailed steps are as below:
-
how to build Intel Chainer Docker image
$ cd docker/python2
$ sudo docker build --build-arg http_proxy=http://proxy-addr:proxy-port/ --build-arg https_proxy=https://proxy-addr:proxy-port/ -t chainer:cpu .
-
how to run Intel Chainer Docker image
$ sudo docker images
$ sudo docker run -it chainer:cpu /bin/bash
-
how to solve docker container proxy issue
users need to update proxy setting as below if they build/run docker behind a HTTP proxy:
$ mkdir -p /etc/systemd/system/docker.service.d
$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
add below content:
[Service] Environment="HTTP_PROXY=http://[proxy-addr]:[proxy-port]/"
if users are behind an HTTPS proxy server, they need to create a file called /etc/systemd/system/docker.service.d/https-proxy.conf and add the HTTPS_PROXY environment variable as below:
[Service] Environment="HTTPS_PROXY=https://[proxy-addr]:[proxy-port]/"
and then update configuration and restart the docker service:
$ systemctl daemon-reload
$ systemctl restart docker
-
how to solve docker container "apt-get update" failure issue
If users can't execute sudo apt-get update successfully in docker container, it might because of DNS issue. Users can follow up below steps to have a try:
first, check the primary and secondary DNS server addresses:
$ nmcli dev show | grep 'IP4.DNS'
IP4.DNS[1]: 10.0.0.2
IP4.DNS[2]: 10.0.0.3
second, create a file /etc/docker/daemon.json:
$ sudo vi /etc/docker/daemon.json
third, put following content in /etc/docker/daemon.json:
{ "dns": ["10.0.0.2", "10.0.0.3"] }
finally, restart docker:
$ sudo service docker restart