通过docker安装Gitlab

通过docker安装Gitlab

摘要

通过docker安装Gitlab

gitlab docker镜像

ubuntu14.04安装docker-compose

curl -L https://github.com/docker/compose/releases/download/1.9.0/run.sh > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

参考 https://docs.docker.com/compose/install/

docker-compose.yml

web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: 'git.javablog.net'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'http://git.javablog.net:9090'
      gitlab_rails['gitlab_shell_ssh_port'] = 2224
  ports:
    - '9090:9090'
    - '444:443'
    - '2224:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

安装gitlab参考链接

https://docs.gitlab.com/omnibus/docker/README.html
Make sure you are in the same directory as docker-compose.yml and run docker-compose up -d to start GitLab

效果

附加:如何关闭ubuntu防火墙(iptables)

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
#存储规则
/sbin/iptables-save > /etc/iptables.up.rules
##开机还原防火墙规则
sudo vi /etc/rc.local
#在exit 0上一行添加如下内容
/sbin/iptables-restore < /etc/iptables.up.rules