# 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 # This is an autoconfigured IPv6 interface auto enp3s0 iface enp3s0 inet static # static为静态模式,DHCP为自动获取 address *静态IP地址* # 服务器静态IP地址 netmask 255.255.255.0 # 子网掩码 gateway *网关* # 网关 dns-nameservers 114.114.114.114 # DNS服务器
上述代码中星号包围的地方请自行咨询实验室负责人
重启网络服务
1
/etc/init.d/networking restart
接下来为了解决我天朝众所周知的网络原因,修改apt源地址
1
vi /etc/apt/sources.list
修改为(阿里云的源):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
然后更新源
1
apt-get update
0x03 安装docker
使用以下命令安装docker:
1 2
apt-get install docker.io service docker restart # 害怕没自动启动服务,所以装完总要重启一遍服务,我有强迫症