1 安装与配置,最好参考官方文档
我使用的是ubuntu14.04,所以参考地址在这里https://docs.docker.com/engine/installation/linux/ubuntu/#os-requirements
2下面具体步骤我贴出来
1 docker安装最新版 2 最新版docker安装,可能会涉及到翻墙,所以加入google host 3 地址:https://github.com/racaljk/hosts 4 sudo apt-get remove docker docker-engine 5 sudo apt-get update 6 sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual 7 sudo apt-get install apt-transport-https ca-certificates curl software-properties-common 8 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 9 sudo apt-key fingerprint 0EBFCD88 10 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 11 sudo apt-get update 12 apt-get install docker-ce 13 docker --version
3 docker的增强工具
1 docker的连接工具 2 sudo apt install gcc 3 sudo apt install make 4 wget https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.tar.gz 5 tar xzvf util-linux-2.24.tar.gz 6 cd util-linux-2.24 7 ./configure --without-ncurses 8 make nsenter 9 看PATH路径 10 sudo cp nsenter /bin or 下面的情况 11 sudo cp nsenter /usr/local/bin 12 wget -P ~ https://github.com/yeasy/docker_practice/raw/master/_local/.bashrc_docker 13 echo "[ -f ~/.bashrc_docker ] && . ~/.bashrc_docker" >> ~/.bashrc; source ~/.bashrc 14 会增加一些好用的命令 15 root@ubuntu:/data/docker# docker- 16 docker-containerd docker-containerd-shim docker-init docker-pid docker-runc 17 docker-containerd-ctr docker-enter docker-ip docker-proxy 18 例如进入docker 19 docker-enter <id>
20 非root下执行
21 wget -P ~ https://github.com/yeasy/docker_practice/raw/master/_local/.bashrc_docker
22 echo "[ -f ~/.bashrc_docker ] && . ~/.bashrc_docker" >> ~/.bashrc; source ~/.bashrc