在本地主机上的 Windows 10 中使用 docker 镜像运行 GitLab

时间:2020-12-30 11:33:07

标签: docker gitlab gitlab-ci gitlab-ci-runner

我在 Windows 10 上安装了一个 docker 镜像“gitlab/gitlab-ce”,我尝试使用以下命令运行。

docker run --detach --hostname https://localhost/ --publish 40443:80 --name GitLab --restart always --volume d:\gitlab\config:/etc/gitlab --volume d:\gitlab\logs:/var/log/gitlab --volume d:\gitlab\data:/var/opt/gitlab gitlab/gitlab-ce:latest

但是当它无法在浏览器中访问时。 “无法访问此站点。 localhost 意外关闭了连接。”

我不知道 GitLab 文档中有什么问题,主机名是“gitlab.example.com”,我不知道域指的是什么。

2 个答案:

答案 0 :(得分:0)

您的 docker 容器暴露在 :40443 端口

参考:https://docs.docker.com/config/containers/container-networking/

附言主机名应该没有 https://

答案 1 :(得分:0)

你应该使用你自己的ip而不是“localhost”这个词。因为docker的localhost IP是不同的。所以你应该用ipconfig cmd命令检查你的ip地址。并用你的ip设置docker run命令地址。

我已经在这个评论中一步一步地写了:https://stackoverflow.com/a/66357935/11040700