下载CentOS7镜像

Download EverythingISO

安装CentOS7镜像

Memory: 6GB
Virtual hard disk: VDI, Dynamically allocated, 24GB
在安装过程中,安装类型选择"GNOME Desktop"

安装Guest Additions

  1. Devices -> Insert Guest Additions CD Image...
  2. Double click and "Run Software"
  3. Reboot

无法访问网络的问题

  1. Settings -> Network -> Attached to "NAT"
  2. 登陆后,右上角点击"Wired Off" -> "Connect"

设置共享文件夹

  1. Settings -> Shared Folders -> Mount "/Users/foo/bar"
  2. ln -s /media/sf_bar /home/foo/workspace
  3. 添加当前用户至vboxsf组:sudo gpasswd -a foo vboxsf

或者手动mount(注意修改uid和gid):
sudo mount -t vboxsf softwares /home/foo/workspace/ -o uid=1000,gid=1000

安装Docker

  1. sudo yum update
  2. sudo yum install -y yum-utils device-mapper-persistent-data lvm2
  3. sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  4. sudo yum install docker-ce

配置Docker

  1. 添加用户至docker组
sudo groupadd docker
sudo gpasswd -a ${USER} docker  # 当前用户添加到docker组
  1. 开机启动Docker daemon:sudo systemctl enable docker