2

我在默认的 Conf-Generation 之后更改了 docker-compose.yml。我的代理配置看起来像:(我只接触了代理部分)

proxy:
    image: goharbor/nginx-photon:v1.9.4
    container_name: nginx
    restart: always
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
      - NET_BIND_SERVICE
    volumes:
      - ./common/config/nginx:/etc/nginx:z
    networks:
      - harbor
      - web
    dns_search: .
    expose:
      - 8080
    ports:
      - 8081:8080 #only to test if its online
    labels:
      - "traefik.enable=true"
      - "traefik.backend=harbor-backend"
      - "traefik.docker.network=web"
      - "traefik.frontend.rule=Host:harbor.example.com"
      - "traefik.frontend.entryPoints=https,http"
      - "traefik.port=8080"
    depends_on:
      - registry
      - core
      - portal
      - log
    logging:
      driver: "syslog"
      options:  
        syslog-address: "tcp://127.0.0.1:1514"
        tag: "proxy"
networks:
  harbor:
    external: false
  web:
    external: true

在我的 Harbor.yml 中,我将 http 端口保留为 80 并禁用了 https。我的代理配置是默认配置。

Web UI 工作正常,但是当我尝试使用 docker 客户端登录时,我得到以下响应:

root@h2791112:~# docker login registry.example.com
Username: admin
Password:
Error response from daemon: Get https://registry.example.com/v2/: unauthorized: authentication required

这就是与 ui 一起使用的凭证

我错过了一个标签吗?

4

1 回答 1

0

这对我有用:https ://github.com/goharbor/harbor/issues/3114#issuecomment-432962664 按照步骤

于 2020-01-08T00:05:54.290 回答