-
Notifications
You must be signed in to change notification settings - Fork 491
How to build run Intel Caffe Docker image
This wiki is used to provide detail steps of building or running Intel caffe docker image. It also provides solutions for some common docker problems user might meet.
$ docker pull bvlc/caffe:intel
This cmd will download the Intel Caffe docker image from docker hub web. Please note this one was built based on ubuntu and may be not the latest version in the master of Intel Caffe github repo.
$ docker run -it bvlc/caffe:intel /bin/bash
if user want to share host data folder for docker container use, user could use "-v" cmd option like below:
$ docker run -v "~/data/ilsvrc12/lmdb/:/opt/caffe/share" -it bvlc/caffe:intel /bin/bash
User may want to build Intel Caffe Docker by self. The following is detail steps:
$ cd docker
$ make cpu-ubuntu
or $ docker build --build-arg http_proxy=http://proxy-addr:proxy-port/ --build-arg https_proxy=https://proxy-addr:proxy-port/ -t caffe:cpu standalone/cpu-ubuntu
After build, user can check local docker images by
$ docker images
and run specified docker images by ImageId.
If user is building/running docker behind a HTTP proxy, user needs to update proxy setting like below:
$ 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]/"
Or, if you are behind an HTTPS proxy server, create a file called /etc/systemd/system/docker.service.d/https-proxy.conf that adds the HTTPS_PROXY environment variable like 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
If user can't execute sudo apt-get update
successfully in docker container, it's usually because of DNS issue.
User can follow up below steps to have a try:
-
On the docker container, find out 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.3Using these addresses, create a file /etc/docker/daemon.json:
$ sudo vi /etc/docker/daemon.json
Put this in /etc/docker/daemon.json:
{
"dns": ["10.0.0.2", "10.0.0.3"]
}Now restart docker:
$ sudo service docker restart
-
VERIFICATION:
Now check that adding the /etc/docker/daemon.json file allows you to resolve 'google.com' into an IP address:
$ docker run busybox nslookup google.com
Server: 10.0.0.2
Address 1: 10.0.0.2
Name: google.com
Address 1: 2a00:1450:4009:811::200e lhr26s02-in-x200e.1e100.net
Address 2: 216.58.198.174 lhr25s10-in-f14.1e100.net
User need register an account in docker hub and then login through below cmd:
$ docker login -u username -p password