本文描述docker的安裝linux
參考官方文檔:https://docs.docker.com/engine/installation/linux/ubuntulinux/docker
安裝操做系統:ubuntu
Ubuntu 14.04app
sudo usermod -aG docker ubuntutcp
修改該文件/etc/default/grub優化
設置屬性值GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"spa
更新sudo update-grub操作系統
重啓reboot.net
修改文件:/etc/default/ufw3d
sudo nano /etc/default/ufw
DEFAULT_FORWARD_POLICY="ACCEPT"
重啓ufw功能
sudo ufw reload
容許鏈接到docker端口
sudo ufw allow
2375/tcp
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
內容:deb https://apt.dockerproject.org/repo ubuntu-trusty main
sudo apt-get purge lxc-docker
sudo apt-get update
sudo apt-cache policy docker-engine
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r)
Ubuntu 14.04 or 12.04須要安裝 apparmor
apt-get install apparmor
安裝
docker
sudo apt-get update
sudo apt-get install docker-engine
sudo service docker start
sudo docker run hello-world
Sudo docker info: