- A+
所属分类:未分类
1:搜索docker的gitlab镜像
docker search gitlab
2:下载镜像
docker pull gitlab/gitlab-ce
3:查看镜像信息
docker inspect gitlab/gitlab-ce
这一块主要是看镜像的端口和对外的目录以及环境变量,内容如下
[ { "Id": "sha256:c99220f804f887b1fa55d1fdd76e633f4dedb2481f72e4f9576f09e44d5dbce9", "RepoTags": [ "gitlab/gitlab-ce:latest" ], "RepoDigests": [ "gitlab/gitlab-ce@sha256:0dd22880358959d9a9233163147adc4c8f1f5d5af90097ff8dfa383c6be7e25a" ], "Parent": "", "Comment": "", "Created": "2018-10-15T13:46:34.509303361Z", "Container": "39daa03445cebd71d2eaab9e2e3803ac3cc9a57c924dc6ed7dbde11abf095f66", "ContainerConfig": { "Hostname": "39daa03445ce", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "22/tcp": {}, "443/tcp": {}, "80/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/opt/gitlab/embedded/bin:/opt/gitlab/bin:/assets:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM=xterm" ], "Cmd": [ "/bin/sh", "-c", "#(nop) ", "HEALTHCHECK &{[\"CMD-SHELL\" \"/opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10\"] \"1m0s\" \"30s\" \"0s\" '\\x05'}" ], "Healthcheck": { "Test": [ "CMD-SHELL", "/opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10" ], "Interval": 60000000000, "Timeout": 30000000000, "Retries": 5 }, "ArgsEscaped": true, "Image": "sha256:5efc7e51d2d58ab15cc805ee2c4c394037ef59d9bb63f5e91ce0bb1ae0bba8b1", "Volumes": { "/etc/gitlab": {}, "/var/log/gitlab": {}, "/var/opt/gitlab": {} }, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": {}, "Shell": [ "/bin/sh", "-c" ] }, "DockerVersion": "18.06.1-ce", "Author": "GitLab Inc. <support@gitlab.com>", "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "ExposedPorts": { "22/tcp": {}, "443/tcp": {}, "80/tcp": {} }, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/opt/gitlab/embedded/bin:/opt/gitlab/bin:/assets:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM=xterm" ], "Cmd": [ "/assets/wrapper" ], "Healthcheck": { "Test": [ "CMD-SHELL", "/opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10" ], "Interval": 60000000000, "Timeout": 30000000000, "Retries": 5 }, "ArgsEscaped": true, "Image": "sha256:5efc7e51d2d58ab15cc805ee2c4c394037ef59d9bb63f5e91ce0bb1ae0bba8b1", "Volumes": { "/etc/gitlab": {}, "/var/log/gitlab": {}, "/var/opt/gitlab": {} }, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": null, "Shell": [ "/bin/sh", "-c" ] }, "Architecture": "amd64", "Os": "linux", "Size": 1472113638, "VirtualSize": 1472113638, "GraphDriver": { "Name": "overlay", "Data": { "RootDir": "/var/lib/docker/overlay/35abe6065ce245eadf0e6a2d97a5287658623db364f316c936a8ea4933b6efa2/root" } }, "RootFS": { "Type": "layers", "Layers": [ "sha256:8823818c474862932702f8a920abea43b2560ddceb910d145be9ba0eb149a643", "sha256:19d043c86cbcb68e4f8363bf0363a2110af6e627eb9051cda1e8fc6ce1e43d7f", "sha256:883eafdbe580e33bf34cb29e9c4c01a5fd7812f7ab93f9950cad1875e13e3915", "sha256:4775b2f378bb7a98f1d64d2af7ee14251acd027c115065691719367c739ef25a", "sha256:75b79e19929ce80a6ec6c059616338272fbac9173fdd5be1ee48b949261770cf", "sha256:c7f5d9e13d36a9ad3cf68b153b19ef193671d0ed0d591979155a3b4c15709d5e", "sha256:f37afe77245bec7ec197c1cc8b2de0f30a51e8a0ba16e3696b9635177916318e", "sha256:bde43b20fb3dc5348ab49fe2b2a891bb27e2bb1d4b7a22c6da9c7eff5ddae405", "sha256:2109cfdf0d17508b13e5900b9a59b14bec793acfc206dc7948cb4859ad42a15e", "sha256:fc226668bfbb6e11f1d5129f3852ebc244b244a8aa632657f1e61f96effc0f24", "sha256:b11f65540f1031babc4ce6bb047d45bd073ffe5bc18d54a60f79d975040ddcd9" ] } } ]
创建对外的对应目录
mkdir -p /data/gitlab/config mkdir /data/gitlab/logs mkdir /data/gitlab/data
启动镜像
docker run --name=gitlab -d \ --publish 1443:443 --publish 80:80 \ --restart always \ --volume /data/gitlab/config:/etc/gitlab \ --volume /data/gitlab/logs:/var/log/gitlab \ --volume /data/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
访问地址:http://ip/搞定
- 安卓客户端下载
- 微信扫一扫
- 微信公众号
- 微信公众号扫一扫