Traefik 和 Harbor

Traefik and Harbor

我在默认的 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

一起使用的凭据

我是不是漏了一个标签?

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