You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker Login(Mac版Docker)如何知晓Artifactory运行的8081端口?

How Mac Docker Client Detects Artifactory's 8081 Port for Login

Great question! Let's break down the possible ways your Mac Docker client is figuring out to use port 8081 for Artifactory, even though you're only specifying docker.artifactory in the docker login command:

  • Docker Desktop Registry Configuration
    The most common scenario is that you’ve pre-configured the repository’s port in Docker Desktop. On Mac, Docker Desktop lets you define insecure-registries or explicit registry endpoints that include port numbers. For example, if you added "insecure-registries": ["docker.artifactory:8081"] in Settings > Docker Engine, the Docker client will automatically associate this domain with port 8081—prioritizing this over the default Registry ports (80/443, or your mentioned 8080) when you run docker login docker.artifactory.

  • HTTP Redirects from Artifactory
    Another possibility is that when your Docker client tries connecting to docker.artifactory:8080 (the default Registry port you referenced), Artifactory returns an HTTP 3xx redirect pointing to the Docker repository endpoint on port 8081. Docker clients are designed to follow valid redirects by default, so it will automatically switch to port 8081 to complete the login flow. This requires Artifactory to have redirect rules configured to route 8080 Registry traffic to its 8081 Docker repository.

  • Local Port Forwarding/Proxy
    You might have a local port forwarding setup on your Mac (using tools like pfctl, or third-party proxy apps) that forwards traffic from your machine’s port 8080 to the target IP’s port 8081. When you run docker login docker.artifactory, the client connects to port 8080 by default, but the local forwarding routes that traffic to Artifactory’s 8081 port—making it seem like the client "automatically detected" the port.

  • Artifactory's Dual Port Listening
    Less likely, but possible: Artifactory might be configured to listen on both port 8080 and 8081, with its Docker repository enabled on both ports. Even though you assumed it only runs on 8081, a quick check of Artifactory’s network settings could confirm if 8080 is also serving the Docker repository.

To pinpoint the exact cause, you can:

  • Check your Docker Desktop settings (the Docker Engine config file is typically at ~/.docker/config.json, or accessible via the GUI)
  • Review Artifactory’s HTTP access logs to look for redirect requests
  • Verify local port forwarding rules on your Mac using sudo pfctl -s nat or similar commands

内容的提问来源于stack exchange,提问作者James Lee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:25:36