OSX 10.11.3使用docker安装gitlab服务器 [英] OSX 10.11.3 Install gitlab server using docker
问题描述
我使用docker安装gitlab服务器。
首先我安装Docker Toolbox,然后按照以下步骤:
步骤1.启动postgresql容器
docker run --name gitlab-postgresql -d \
--env'DB_NAME = gitlabhq_production'\\ \\
--env'DB_USER = gitlab'--env'DB_PASS = password'\
--volume / srv / docker / gitlab / postgresql:/ var / lib / postgresql \
sameersbn / postgresql:9.4-12
步骤2.启动一个redis容器
docker run --name gitlab-redis -d \
--volume / srv / docker / gitlab / redis: / var / lib / redis \
sameersbn / redis:最新
步骤3.启动gitlab容器
docker run --name gitlab -d \
--link gitlab-postgresql:postgresql - -link gitlab-redis:redisio \
--publish 10022:22 - 发布10080:80 \
--env'GITLAB_PORT = 10080'--env'GITLAB_SSH_PORT = 10022'\\ \\
--env'GITLAB_SECRETS_DB_KEY_BASE = long-and-random-alpha-numeric-string'\
--volume / srv / docker / gitlab / gitlab:/ home / git / data \
sameersbn / gitlab:8.4.2
结束后,我可以通过 http://192.168.99.100:10080 访问gitlab服务器,并可以创建一个项目,但是我无法通过 http:// localhost:10080 访问gitlab服务器,其他人无法上传和下载,不应该做端口转发,我应该怎么do?
不应该进行端口转发
实际上,你应该通过承载基于boot2docker的Linux的虚拟机,向您的实际主机(Windows或Mac)端口转发10080。
参见连接到从Docker容器运行的服务utp
VBoxManage controlvmdefaultnatpf1tcp-port10080,tcp ,, 10080,,10080
VBoxManage controlvmdefaultnatpf1udp-port10080,udp ,, 10080,,10080
default 与您的docker-machine的名称:见 docker-machine ls
)
My English not good, sorry! I install gitlab server using docker.
First I install Docker Toolbox,and then I follow the steps below:
Step 1. Launch a postgresql container
docker run --name gitlab-postgresql -d \
--env 'DB_NAME=gitlabhq_production' \
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
--volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
sameersbn/postgresql:9.4-12
Step 2. Launch a redis container
docker run --name gitlab-redis -d \
--volume /srv/docker/gitlab/redis:/var/lib/redis \
sameersbn/redis:latest
Step 3. Launch the gitlab container
docker run --name gitlab -d \
--link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
--publish 10022:22 --publish 10080:80 \
--env 'GITLAB_PORT=10080' --env 'GITLAB_SSH_PORT=10022' \
--env 'GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string' \
--volume /srv/docker/gitlab/gitlab:/home/git/data \
sameersbn/gitlab:8.4.2
After the end,I can by http://192.168.99.100:10080 access to gitlab server, and can create a project, but I can't through the http://localhost:10080 access to gitlab server, others can not upload and download, should not do port forwarding, I should how to do?
should not do port forwarding
Well actually yuo should do a port-forward 10080 to your actual host (Windows or Mac) through the VM which hosts the boot2docker-based Linux.
See "Connect to a Service running inside a docker container from outside"
VBoxManage controlvm "default" natpf1 "tcp-port10080,tcp,,10080,,10080"
VBoxManage controlvm "default" natpf1 "udp-port10080,udp,,10080,,10080"
(Replace default
with the name of your docker-machine: see docker-machine ls
)
这篇关于OSX 10.11.3使用docker安装gitlab服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!