獲取鏡像
docker pull gitlab/gitlab-ce
運行鏡像
sudo docker run --detach \
--hostname git.xxxx.com \
--publish 8443:443 --publish 9090:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
進入容器
docker exec -it gitlab /bin/bash
超時配置 timeout時間
/var/opt/gitlab/gitlab-rails/etc/unicorn.rb
重啟gitlab
docker restart gitlab
查看日志
docker logs --tail 0 -f 容器ID
安裝gogs
docker pull mysql/mysql-server:latest
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql/mysql-server:latest
docker exec -it ce33e66bd8a5 /bin/sh
mysql -uroot -p -h localhost
[root@localhost ~]# docker pull gogs/gogs
Using default tag: latest
Trying to pull repository docker.io/gogs/gogs ...
latest: Pulling from docker.io/gogs/gogs
b1f00a6a160c: Pull complete
219d6f70b7c7: Pull complete
d7347dd7b842: Pull complete
91781f374319: Pull complete
2af6e1a042d8: Pull complete
c8aa11c846cd: Pull complete
63ac2f7bab89: Pull complete
75e74f5ba116: Pull complete
8c5f51d39741: Pull complete
5e9f52d4c77e: Pull complete
4f319b1c39f5: Pull complete
Digest: sha256:f770a8d3f5f38bd7905ec030f3e66da800c21ce6f9c91c5c48199e6ac31f3010
[root@localhost ~]#
docker run -d --name=mygogs -p 2222:22 -p 9090:3000 -v /srv/gogs:/data gogs/gogs
最后編輯于 :
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者