Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

How to build run Intel Caffe Docker image

Tian, Feng edited this page Oct 24, 2017 · 5 revisions

Intention

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.


Run Intel Caffe Docker Image as a container

$ 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


Build Intel Caffe Docker Image by self

As the docker image in docker hub may not be built based on the latest version in Intel Caffe github repo, user may want to build Intel Caffe Docker by self. The following is detail steps:

$ cd docker

$ make cpu-ubuntu or $ docker build -t caffe:cpu standalone/cpu-ubuntu

After build, user can check local docker images by

$ docker images

and run specified docker images by ImageId.


Solve docker container proxy issue

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


Solve docker container "apt-get update" failure issue

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:

  1. 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.3

    Using 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

  2. 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

Solve "docker unauthorized: authentication required" issue

User need register an account in docker hub and then login through below cmd:

$ docker login -u username -p password

Clone this wiki locally