【问题标题】:How do I solve the error: ErrorCode 22 The requested URL returned error: 502 Bad Gateway" when running Gitlab Image in Docker?如何解决错误:ErrorCode 22 The requested URL returned error: 502 Bad Gateway" 在 Docker 中运行 Gitlab Image 时?
【发布时间】:2020-06-09 08:46:15
【问题描述】:

我运行 docker 命令:

sudo docker run --detach \
  --publish 4443:443 --publish 7000:80 --publish 2222:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/gitlab/config:/etc/gitlab:\
  --volume $GITLAB_HOME/gitlab/logs:/var/log/gitlab\
  --volume $GITLAB_HOME/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

当我运行 docker 检查时,结果包含 “健康”: { “状态”:“开始”, “连续失败”:4, “日志”: [ { "开始": "2020-06-09T08:33:29.190118286Z", “结束”:“2020-06-09T08:33:32.692188421Z”, “退出代码”:22, "输出": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:-- --:-- :-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\ncurl: (22) 请求的 URL 返回错误:502 Bad Gateway\n" },

我该如何解决这个错误?

【问题讨论】:

  • 你能得到图像 gitlab/gitlab-ce:latest 以响应命令“docker images”

标签: docker gitlab


【解决方案1】:

正如您在文档https://docs.gitlab.com/omnibus/docker/ 中看到的,您必须使用此调用

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

【讨论】:

  • 我运行了你建议的命令。我仍然得到同样的错误。 "ExitCode": 22, "Output": " % Total % Received % Xferd Average Speed Time Time Time Time Current\n Dload Upload Total Left Speed\n\r 0 0 0 0 0 0 0 0 --:--:- - --:--:-- --:--:-- 0\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--: -- 0\nurl: (22) 请求的 URL 返回错误: 502 Bad Gateway\n" },
  • docker ps 容器 ID 图像命令创建状态端口名称 71cd6c7aff8e gitlab/gitlab-ce:latest "/assets/wrapper" 11 分钟前 5 分钟前(不健康)0.0.0.0:22->22/ tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp gitlab Steins-MacBook-Air:~ steinkorsveien$ docker inspect 71cd6c7aff8e [
  • 您是否仔细阅读了完整的文档?例如 --> 注意:Docker for Windows 不受官方支持。
猜你喜欢
  • 2020-12-11
  • 2020-10-26
  • 2021-08-16
  • 1970-01-01
  • 2021-02-10
  • 2021-09-07
  • 2019-02-08
  • 2017-01-04
  • 1970-01-01
相关资源
最近更新 更多