前言
搭建Redmine环境可以选择使用分别安装Ruby+Rails+Redmine+MySQL的方式,
但是过程中需要解决各种扰人的依赖问题。Docker为我们提供的Plan B,方便,快捷。
安装环境
当然可以选择Ruby+Rails+Redmine+MySQL的安装方式,请参考:
阿里云ECS安装
因为是实际生产需要,所以,直接购买阿里云的ECS。
安装和使用方法参考:
安装CentOS 7.0
Docker官方的说明:
“系统的要求跟 Ubuntu 情况类似,64 位操作系统,内核版本至少为 3.10。
Docker 目前支持 CentOS 6.5 及以后的版本,推荐使用 CentOS 7 系统。”
所以购买ECS后,请选择CentOS 7系统。
CentOS 7内核升级
更新内核两种方法,编译安装和非编译安装:
编译安装
非编译安装
我选择的是非编译安装方式,很方便。
升级流程
1,查看内核版本
uname -r
3.8.0-44-generic
2,导入 Public Key
3,安装 ELRepo
4,升级 Kernel
yum --enablerepo=elrepo-kernel install kernel-lt -y
5,更改 Grub
vim/etc/grub.conf
根据安装好以后的内核位置,修改 default 的值,一般是修改为0,因为 default 从 0 开始,一般新安装的内核在第一个位置,
所以设置default=0。就是文件最上面的那个default
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.28-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8
6,重启CentOS
init 6
7,查看内核版本
uname -r
3.10.0-327.18.2.el7.x86_64
8,内核升级完成
安装Docker
1,添加 yum 软件源
sudo tee /etc/yum.repos.d/docker.repo <
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
2,更新 yum 软件源缓存
yum update
3,安装 docker-engine
yum install -y docker-engine
4,配置让 Docker 服务在系统启动后自动启动。
CentOS 7中支持的新式 systemd 语法,如下:
systemctl start docker.service
systemctl enable docker.service
另附旧语法,如下:
service docker start
chkconfig docker on
5,Docker安装完成
让我们测试一下,Docker是否安装成功:
1,查看Docker版本
# docker version
Client:
Version: 1.9.1
API version: 1.21
Package version: docker-common-1.9.1-40.el7.centos.x86_64
Go version: go1.4.2
Git commit: ab77bde/1.9.1
Built:
OS/Arch: linux/amd64
Server:
Version: 1.9.1
API version: 1.21
Package version: docker-common-1.9.1-40.el7.centos.x86_64
Go version: go1.4.2
Git commit: ab77bde/1.9.1
Built:
OS/Arch: linux/amd64
2,输入Docker然后回车,可以打印Docker的所有命令
# docker
Usage: docker [OPTIONS] COMMAND [arg...]
docker daemon [ --help | ... ]
docker [ --help | -v | --version ]
A self-sufficient runtime for containers.
Options:
--config=~/.docker Location of client