本篇内容介绍了“怎么搭建docker-gitlab-jenkins”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
yum -y install docker-io systemctl enable docker service docker start docker images
进入阿里云后台
进入"容器镜像服务"
进入"镜像加速"
查看"加速器地址": https://q2n4xzh2.mirror.aliyuncs.com
# vim /etc/docker/daemon.json { "registry-mirrors": ["https://q2n4xzh2.mirror.aliyuncs.com"] }
systemctl daemon-reload service docker restart
mkdir -p /data/gitlab
docker run --detach \ --hostname gitlab \ --publish 1443:443 --publish 1222:22 \ --name gitlab \ --restart always \ --volume /data/gitlab/config:/etc/gitlab \ --volume /data/gitlab/logs:/var/log/gitlab \ --volume /data/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
mkdir -p /data/gitlab/config/ssl cp /usr/local/openresty/nginx/conf/cert/code.weflys.com.* /data/gitlab/config/ssl/
# vim /data/gitlab/config/gitlab.rb external_url 'https://code.weflys.com' nginx['redirect_http_to_https'] = true nginx['ssl_certificate'] = "/etc/gitlab/ssl/code.weflys.com.pem" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/code.weflys.com.key" gitlab_rails['gitlab_shell_ssh_port'] = 1222
说明:阿里云需要开放1222端口
docker cp /etc/timezone gitlab:/etc/timezone docker cp /usr/share/zoneinfo/Asia/Shanghai gitlab:/etc/localtime
docker restart gitlab
docker logs -f gitlab
等待 gitlab 启动成功
server { listen 80; server_name code.weflys.com; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 443 ssl; server_name code.weflys.com; root html; index index.html; ssl_certificate cert/code.weflys.com.pem; ssl_certificate_key cert/code.weflys.com.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { proxy_pass https://127.0.0.1:1443; } include error.conf; }
mkdir -p /data/jenkins/jenkins_home
docker pull jenkins/jenkins
docker run -d \ --name jenkins \ -v /data/jenkins/jenkins_home:/var/jenkins_home \ -p 18095:8080 \ -p 50000:50000 \ -u 0 \ --restart always \ jenkins/jenkins
docker cp /etc/timezone jenkins:/etc/timezone docker cp /usr/share/zoneinfo/Asia/Shanghai jenkins:/etc/localtime
docker start jenkins
docker logs -f jenkins
“怎么搭建docker-gitlab-jenkins”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。