Welcome 微信登录

首页 / 操作系统 / Linux / Docker的搭建Gitlab CI 全过程详解

目录配置环境:
宿主机:Ubuntu 13.04 (x86_64)
docker版本:0.7.0
Gitlab    版本:4.2.0(已经搭建好的)
Gitlab CI版本:3.2.0
一、从index.docker.io搜寻所需镜像。
二、去https://index.docker.io获取镜像相关的信息。
三、修改镜像使镜像符合自己的需要。
四、让自己的镜像跑起来。

配置环境:

 

宿主机:Ubuntu 13.04 (x86_64)

 

Docker版本:0.7.0

Client version: 0.7.0
Go version (client): go1.2rc5
Git commit (client): 0d078b6
Server version: 0.7.0
Git commit (server): 0d078b6
Go version (server): go1.2rc5
Last stable version: 0.7.0

Gitlab 版本:4.2.0(已经搭建好的)

 

Gitlab CI版本:3.2.0

 

一、从index.docker.io搜寻所需镜像。

当然是去我们最可爱得index.docker.io上去搜寻啦。sudo docker search gitlab-ci          #从docker index搜寻gitlab-ci的镜像这里有很多的可用image很多,这些都是用户上传的,可以自己选择,我一般都是看TRUSTED栏有ok的就可以,这是我自己猜的啊,你根据自己的经验来就行。我选的是anapsix/gitlab-ci,看这个比较顺眼,就它了。二、去https://index.docker.io获取镜像相关的信息。别着急让你下载的镜像跑起来,我们把别人的成果偷来之后总不能不会用把,接着去https://index.docker.io 去看看我们偷来的东西是谁的,怎么样让这个东东跑起来。看看,人家都教你怎么用啦。人家还告诉你怎么做的这个镜像,就是我们的Dockerfile。不过我是要和自己内网的Gitlab上用,所以直接拷贝下来的东西不能用。这是Dockerfile的内容:FROM tianon/debian  #基础镜像包MAINTAINER Anastas Semenov <anapsix@random.io>    #作者
<P>
RUN apt-get update  #run跑的是命令
</P>
#底下这一部分和实体机上安装类似,但是还是有很大的不同,我就掉进这个坑里去过。
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev libyaml-dev libicu-dev zlib1g-dev libsqlite3-dev wget curl gcc build-essential make git sudo postfix cron ruby1.9.1 ruby1.9.1-dev rubygems-integration redis-serverRUN gem install bundle --no-ri --no-rdocRUN adduser --disabled-login --gecos "GitLab CI" gitlab_ciRUN cd /home/gitlab_ci; sudo -u gitlab_ci -H git clone -b 3-2-stable --depth 1 https://github.com/gitlabhq/gitlab-ci.git gitlab-ci
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H mkdir -p tmp/pids tmp/sockets
RUN cd /home/gitlab_ci/gitlab-ci; curl -sL https://raw.github.com/anapsix/gitlabci-docker/master/BUNDLER-adding-sqlite3-support.patch | sudo -u gitlab_ci -H git am
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H bundle install --without development test postgres mysql --deployment
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H curl -sL https://raw.github.com/anapsix/gitlabci-docker/master/gitlab_ctrl.rb > ./gitlabci_ctrl.rb; chmod +x ./gitlabci_ctrl.rb
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H ./gitlabci_ctrl.rb --db --puma --app GITLAB_URLS="https://dev.gitlab.org/"
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H bundle exec rake db:setup RAILS_ENV=production
RUN cd /home/gitlab_ci/gitlab-ci; sudo -u gitlab_ci -H bundle exec whenever -w RAILS_ENV=production# cleanup, if needed
#RUN DEBIAN_FRONTEND=noninteractive apt-get remove --force-yes -y ruby1.9.1-dev
#RUN DEBIAN_FRONTEND=noninteractive apt-get autoremove --force-yes -y
EXPOSE 9000    #container开的端口WORKDIR /home/gitlab_ci/gitlab-ci
CMD /home/gitlab_ci/gitlab-ci/gitlabci_ctrl.rb --start      #启动命令就相当与你偷了别人的东西(打个比如)不会用,去找人家,人家还告诉你这个东西怎么用,而且还告诉你这个东西是怎么做出来的。哈哈哈,真是个好yin。GitLab 的详细介绍:请点这里
GitLab 的下载地址:请点这里相关阅读:GitLab 5.3 升级注意事项 http://www.linuxidc.com/Linux/2013-06/86473.htm在 CentOS 上部署 GitLab (自托管的Git项目仓库) http://www.linuxidc.com/Linux/2013-06/85754.htmGitlab在Ubuntu 12.04.2上面的安装配置教程 http://www.linuxidc.com/Linux/2013-11/92686.htmGitlab 6.3 社区版发布 http://www.linuxidc.com/Linux/2013-11/93092.htm
  • 1
  • 2
  • 3
  • 下一页
持续集成环境Gitlab CI的官方安装过程解析Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.相关资讯      Docker  Gitlab CI 
  • Docker 1.12.0 改进了服务的负载均  (今 20:20)
  • docker-gitlab部署  (05月31日)
  • GitLab联合DigitalOcean为开源社区  (05月08日)
  • CentOS 7下为Docker容器分配固定IP  (07月12日)
  • docker-gitlab搭建使用及问题解决  (05月31日)
  • Docker与虚拟机性能比较  (05月04日)
本文评论 查看全部评论 (0)
表情: 姓名: 字数