It gives SSH and http addresses like this:
git@6b30d4a6a162:compontent/gitlab-test-component.git
http://6b30d4a6a162/compontent/gitlab-test-component.git
6b30d4a6a162 is part of the ID of gitlab’s container Info:
6b30d4a6a16279326a135ee2c7bf7b20094b3199a299ac6345735dd3
I cannot git clone through the above two addresses.
Because I did a simple port mapping with virtualbox, I tried to use
git clone http://localhost:8100/compontent/gitlab-test-component
But an error will be reported: 500
Do you know anything?
In addition, I would like to ask whether ssh-key can only be generated once, and github, gitlab, or other places can be placed everywhere in the same copy.
Because host’s port 22 is already occupied
When docker run, map 22 port of container to other ports of host, such as 2222
docker run gitlab -p 2222:22
Url needs to be specified in gitlab’s configuration file.
# modify first line of /etc/gitlab/gitlab.rb file external_url 'http://192.168.1.23/'
In this way, what is displayed in the project warehouse is
git@192.168.1.23:2222/shadowsocks/shadowsocks.git
Then you can use git
git clone git@192.168.1.23:2222/shadowsocks/shadowsocks.git
At this time, it needs to be configured on the development machine.
.ssh/config
File, can normal useThe following is an example of using docker to run gitlab
docker run --name='gitlabend' --link gitlab_mysql:mysql \ --link gitlab_redis:redisio \ -e 'GITLAB_PORT=10080' \ -e 'GITLAB_SSH_PORT=10022' \ -p 10022:22 -p 10080:80 \ -e 'GITLAB_HOST=xxxx' \ -e 'GITLAB_EMAIL=user@mail.com' \ -e 'SMTP_ENABLED=true' \ -e 'SMTP_DOMAIN=qq.com' \ -e 'SMTP_HOST=smtp.exmail.qq.com' \ -e 'SMTP_PORT=25' \ -e 'SMTP_STARTTLS=false' \ -e 'SMTP_USER=user@mail.com' \ -e 'SMTP_PASS=password' \ -e 'SMTP_AUTHENTICATION=login' \ -v /opt/gitlab/data:/home/git/data \ -v /opt/gitlab/log:/var/log/gitlab \ sameersbn/gitlab:latest