docker部署gitlab、jenkins
docker部署gitlab、jenkins
首先下载gitlab镜像
docker run
--detach
--publish 8443:443
--publish 8090:80
--publish 51558:22
--name gitlab
--restart unless-stopped
-v /mnt/gitlab/etc:/etc/gitlab
-v /mnt/gitlab/log:/var/log/gitlab
-v /mnt/gitlab/data:/var/opt/gitlab
beginor/gitlab-ce:11.0.1-ce.0
本地克隆代码仓库时报错提示如下:
ssh: Could not resolve hostname c4d446439e2f: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
解决办法
docker exec -ti gitlab /bin/bash
将docker的主机名称与ip对应解析到本地的hosts文件中即可
git clone repository //将远程仓库克隆到本地
cd repository // 进入代码库中
git add . //将工作区的内容放入版本库的暂存区
git commit -m "添加描述信息" //将暂存区的内容提交到当前分支
git push -u origin master //推送到master分支
http://10.28.200.57:8080/project/word_press
Hook executed successfully but returned HTTP 404 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 Not Found</title> </head> <body><h2>HTTP ERROR 404</h2> <p>Problem accessing /project/word_press. Reason: <pre> Not Found</pre></p >
< a href=" ">Powered by Jetty:// 9.4.z-SNAPSHOT</ a>
</body> </html>
docker安装jenkins
docker run
--rm
-u root
-p 8080:8080
-v jenkins-data:/var/jenkins_home
-v /var/run/docker.sock:/var/run/docker.sock
-v "$HOME":/home
jenkinsci/blueocean
在链接git的url时会出现报错
解决办法
在jenkins中添加gitlab的域名解析
进入jenkins容器中
docker exec -it jenkins-tutorials bash