gitlab git clone 卡住_gitlab从入门到绝望
啥年月了還用svn,日了狗一樣難受。
開搞!
docker是最好的容器,直接docker裝gitlab。
學(xué)新玩意不去官網(wǎng)不是人:
https://docs.gitlab.com/omnibus/docker/#expose-gitlab-on-different-ports
docker pull gitlab/gitlab-ce
sudo docker run --detach \ ?--hostname gitlab.example.com \ ?--publish 443:443 --publish 80:80 --publish 22: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 \ ?gitlab/gitlab-ce:latest
官網(wǎng)上這樣說,可是他么的他報(bào)錯(cuò)了真的報(bào)錯(cuò)了:
cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied 。他說:掛載的本地目錄在容器中沒有執(zhí)行權(quán)限
解決方案:加權(quán)限 ?--privileged=true 這個(gè)很有用在我的docker文章中也有遇到?jīng)]權(quán)限的情況,遇到?jīng)]權(quán)限先加一下試試。
我試了試,確實(shí)成功了。但是我想改端口!那么官老爺又說了:
For example, to expose the web interface on port?8929, and the SSH service on port?2289, use the following?docker run?command:
sudo docker run --detach \ ?--hostname gitlab.example.com \ ?--publish 8929:80 --publish 2289: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 \
--privileged=true\ ?gitlab/gitlab-ce:latest
(他又忘了加權(quán)限?或者按照官老爺說的這樣可以嗎
If you are on?SELinux?then run this instead:
sudo docker run --detach \--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab:Z \
--volume /srv/gitlab/logs:/var/log/gitlab:Z \
--volume /srv/gitlab/data:/var/opt/gitlab:Z \
gitlab/gitlab-ce:latest
)
Note:?The format for publishing ports is?hostPort:containerPort. Read more in Docker’s documentation about?exposing incoming ports.
(怎樣設(shè)置?
官網(wǎng)上往回看發(fā)現(xiàn):
Configure GitLab
This container uses the official Omnibus GitLab package, so all configuration is done in the unique configuration file?/etc/gitlab/gitlab.rb.
To access GitLab’s configuration file, you can start a shell session in the context of a running container. This will allow you to browse all directories and use your favorite text editor:
sudo docker exec -it gitlab /bin/bashYou can also just edit?/etc/gitlab/gitlab.rb:
sudo docker exec -it gitlab editor /etc/gitlab/gitlab.rbOnce you open?/etc/gitlab/gitlab.rb?make sure to set the?external_url?to point to a valid URL.
可以繼續(xù)了
:)
Set?external_url:
# For HTTPexternal_url "http://gitlab.example.com:8929"
or
# For HTTPS (notice the https)
external_url "https://gitlab.example.com:8929"
For more information see the?NGINX documentation.
Set?gitlab_shell_ssh_port:
gitlab_rails['gitlab_shell_ssh_port'] = 2289Following the above example you will be able to reach GitLab from your web browser under?:8929?and push using SSH under the port?2289.
(我一直有個(gè)疑問,明明端口映射的是2289:22 ?映射的不是22嗎為什么還要這樣子:['gitlab_shell_ssh_port'] = 2289 ?
)然后重啟:
sudo docker restart gitlab
好像這樣也行:gitlab-ctl reconfigure
Note:?The initialization process may take a long time. You can track this process with the command?sudo docker logs -f gitlab
人家說初始化需要很長(zhǎng)時(shí)間你可以看日志或者嗑瓜子
我是不停地賤賤的docker ps
看他一直在restaring。。。。。。盼星星盼月亮終于盼到health狀態(tài)
看招:
首頁(yè)點(diǎn)扳手可以創(chuàng)建用戶創(chuàng)建群組創(chuàng)建項(xiàng)目:
我創(chuàng)建了一個(gè)項(xiàng)目然后再加了一個(gè)readme初始化項(xiàng)目了。
然后貧僧先用http下載項(xiàng)目:
新建文件夾-> git->clone->那個(gè)地址
華麗的分割線
接下來講講用ssh,他們說用ssh方式更囂張
首先配置key
去git的安裝目錄找到usr/bin
C:\Program Files\Git\usr\bin然后地址欄輸入cmd彈出大黑框執(zhí)行:
ssh-keygen -t rsa -C 'xxx@xxx.com'
一路牛b加閃電按回車在用戶目錄下C:\Users\sht\.ssh
生成了一個(gè)id_rsa.pub這個(gè)文件:
編輯器打開復(fù)制內(nèi)容然后到gatlib的ssh秘鑰中添加
搞到那個(gè)大框框里面然后add成功之后去項(xiàng)目里面
復(fù)制新建文件夾clone直接ssh方式克隆,ohyes!
報(bào)錯(cuò)了:
他說我沒權(quán)限,經(jīng)鑒定是小王八git配置問題,我們來配置:
更改完clone:
gameover!
總結(jié)
以上是生活随笔為你收集整理的gitlab git clone 卡住_gitlab从入门到绝望的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 更姓改名什么意思?
- 下一篇: 都江堰向峨乡石花村房价多少钱一平方?