yum remove docker
docker-common
container-selinux
docker-selinux
docker-engine
准备完以上步骤,就可以正式开始在Centos上安装Docker CE。
yum install -y yum-utils
yum-config-manager
–add-repo
https://download.daocloud.io/docker/linux/centos/docker-ce.repo
https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast( yum clean all)
yum install docker-ce
systemctl start docker
至此Docker CE就安装完成了设置开机自启
systemctl enable docker
使用我的 DaoCloud 加速器
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://8ad7943c.m.daocloud.io
cat>/etc/docker/daemon.json<
“registry-mirrors”:[“https://registry.docker-cn.com”]
}
EOF
systemctl restart docker
dockerd --debug查看异常
docker run -d --publish 443:443 --publish 80:80 --publish 23:22 --name gitlab --restart always
–volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab docker.io/gitlab/gitlab-ce:latest
external_url “http://114.116.4.185”
gitlab_rails[‘ldap_enabled’] = true
###! remember to close this block with ‘EOS’ below
gitlab_rails[‘ldap_servers’] = YAML.load <<-‘EOS’
main: # ‘main’ is the GitLab ‘provider ID’ of this LDAP server
label: 'LDAP'
host: '114.116.15.178'
port: 389
uid: 'cn'
bind_dn: 'cn=root,dc=jyyjy,dc=com'
method: 'plain' # "tls" or "ssl" or "plain"
password: '123456'
active_directory: true
allow_username_or_email_login: false
lowercase_usernames: false
block_auto_created_users: false
base: 'ou=People,dc=jyyjy,dc=com'
user_filter: ''
EOS
docker restart 容器ID
docker exec -it 804 gitlab-rails console production
user = User.find_by(username: ‘wufei’)
user.admin = true
user.save!
exit
docker exec -it 804 gitlab-ctl reconfigure
docker run -d -p 5000:5000 --restart=always --name registry -v /mnt/registry:/var/lib/registry registry:2