起因
公司版本管理用的是svn,写个文档word和exce起步,多人协作容易冲突,这些文档还相当的不友善,导致冲突的解决很麻烦。很多东西都是可以用markdown摆平的。之前有centos搭建git服务的经历,这次尝试这用docker来搭建一个本地的git服务,最后把这个镜像导出以后随时拉下来用。
目的
利用docker搭建git+jenkins的ci框架和文档系统。
环境
- Windows 10家庭版x64:逼不得已的,家庭版只能庄docker toolbox
- centos
Docker安装
直接照着官网安装就可以了
拉取centos镜像
可以通过docket拉取官方镜像
1 | docker pull centos |
centos镜像可以通过
1 | docker search centos |
找到一堆,我使用的是第一个,也就是star最多的那个,也即是官方的。
启动centos容器:
1 | docker run -it --name cornfield -p 10080:3000 -v /E/workspace/docker/centos:/usr/local/cornfield centos |
执行成功之后,会进入centos的命令界面,无论如何,我先来一发更新
1 | yum update |
安装依赖项
1 |
|
Failed to get D-Bus connection: Operation not permitted
Failed to get D-Bus connection
安装gitlab
之前搭建过gogs的服务,这次用gitlab试试看。
1 |
|
参考
一个卧槽
突然发现gitlab官方有现成的docker镜像,如果只是搭建gitlab服务的话,直接用这个就可以了。其他官方有在维护3个gitlab镜像的。
Install GitLab with Docker
Install docker
- go to docker official site, Products->Docker Desktop->Download for Windows->Get Docker, remember:login first,otherwise you will find the Get Docker is missing
- Motherfucker, docker for Windows only available for Windows10 Profession/Enterpriuse/Education, but mine is family,so turn out to Docker toolbox
- Get Docker Toolbox for Windows, it will auto install VirtualBox, Docker Client on you PC.
- Waste too much time on boot2docker by command line, and download it directly save it to c:/user/USERNAME/.docker/machine/cache
- docker search centos -> docker pull centos -> docker run -idt centos
- run Kitematic, login and you’ll find your container.
- chose you container, click exec.
- docker run -ti -v /d//workspace/docker/centos:/home/workspace centos, attention the disk synax of Windows
- yum -y install gcc gcc-c++
- set mount file in VirtualBox->settings->share folder
遇到的问题
- [sudo:command not found] https://zhuanlan.zhihu.com/p/35279658