sudo mkdir -p /etc/systemd/system/docker.service.d
vi /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://myproxy.hostname:8080"
Environment="HTTPS_PROXY=https://myproxy.hostname:8080/"
Environment="NO_PROXY="localhost,127.0.0.1,::1"
sudo systemctl daemon-reload
sudo systemctl restart docker.service
docker pull ubuntu:16.04
docker run -it --name ub16 ubuntu:16.04
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
Dockerfile:
FROM ubuntu:16.04
ENV http_proxy $HTTP_PROXY
ENV https_proxy $HTTP_PROXY
docker build . -t docker_image_name
--build-arg HTTP_PROXY=http://x.x.x.x:8888/
--build-arg HTTPS_PROXY=http://x.x.x.x:8888/
taskset -c -p $$
pid 284307's current affinity list: 0-111
docker stop caffe
docker update -c 512 caffe
docker start caffe
docker ps -aq
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)
docker save demo > latest.tar
docker load --input latest.tar
docker export demo > latest.tar
docker import latest.tar container_name
sudo docker commit deddd39fa163 ubuntu-nmap