Docker:修订间差异
来自Ubuntu中文
跳到导航跳到搜索
小 →安装网络 |
|||
第30行: | 第30行: | ||
sudo docker ps | sudo docker ps | ||
sudo pipework br0 551088badf9d 192.168.1.10/24 | sudo pipework br0 551088badf9d 192.168.1.10/24 | ||
== 主机网络配置参考 == | |||
<pre> | |||
~$ cat /etc/network/interfaces | |||
# This file describes the network interfaces available on your system | |||
# and how to activate them. For more information, see interfaces(5). | |||
source /etc/network/interfaces.d/* | |||
# The loopback network interface | |||
auto lo | |||
iface lo inet loopback | |||
# The primary network interface | |||
#auto eno1 | |||
#iface eno1 inet dhcp | |||
auto br0 | |||
iface br0 inet static | |||
address 192.168.1.233 | |||
netmask 255.255.255.0 | |||
gateway 192.168.1.3 | |||
bridge_ports eno1 | |||
bridge_stp off | |||
dns-nameservers 192.168.1.3 192.168.1.2 | |||
</pre> | |||
== 常用地址 == | == 常用地址 == |
2016年12月23日 (五) 10:37的版本
安装
sudo apt-get install apt-transport-https ca-certificates sudo apt-key adv \ --keyserver hkp://ha.pool.sks-keyservers.net:80 \ --recv-keys 58118E89F3A912897C070ADBF76221572C52609D echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt-get update sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual sudo apt-get install docker-engine sudo service docker start
安装 shipyard 面板
curl -s https://shipyard-project.com/deploy | bash -s
安装网络
git clone https://github.com/jpetazzo/pipework.git sudo cp ./pipework/pipework /usr/local/bin/ sudo apt-get install iputils-arping bridge-utils -y #注意配置这个会断网 sudo brctl addbr br0 sudo ip addr add 192.168.1.4/24 dev br0 sudo ip addr del 192.168.1.4/24 dev eno1 sudo ip link set dev br0 up sudo brctl addif br0 eno1 sudo ip route del default sudo ip route add default via 192.168.1.1 dev br0 #echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker
sudo docker ps sudo pipework br0 551088badf9d 192.168.1.10/24
主机网络配置参考
~$ cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface #auto eno1 #iface eno1 inet dhcp auto br0 iface br0 inet static address 192.168.1.233 netmask 255.255.255.0 gateway 192.168.1.3 bridge_ports eno1 bridge_stp off dns-nameservers 192.168.1.3 192.168.1.2
常用地址
https://docs.docker.com/engine/installation/linux/ubuntulinux/
https://github.com/shipyard/shipyard
https://toutiao.io/posts/496585/app_preview
https://opskumu.gitbooks.io/docker/content/chapter6.html
其他客户端初始命令
sed -i "s/archive.ubuntu.com/mirrors.163.com/" /etc/apt/sources.list apt-get update apt-get install net-tools iputils-ping