[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eHarbor instances use TLS certificates from your organization's root CA to encrypt connections and secure images from unauthorized access.\u003c/p\u003e\n"],["\u003cp\u003eBefore interacting with container images, ensure Docker is installed and that the user running Docker commands is added to the Docker security group on Linux or Windows systems.\u003c/p\u003e\n"],["\u003cp\u003eTo enable secure communication, configure your Docker client to trust your organization's root CA by copying the CA's \u003ccode\u003e.crt\u003c/code\u003e file to \u003ccode\u003e/etc/docker/certs.d/<HARBOR_INSTANCE_URL>/ca.crt\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAlternatively, you can use the \u003ccode\u003egdcloud CLI\u003c/code\u003e to sign in to the user cluster and then copy the web CA that is saved in the cluster.\u003c/p\u003e\n"],["\u003cp\u003eAn error message stating the "certificate signed by unknown authority" indicates that the configuration to trust the CA was not successful.\u003c/p\u003e\n"]]],[],null,["# Configure Docker to trust the Harbor root CA\n\nHarbor instances use Transport Layer Security (TLS) certificates issued by your\norganization's trusted root Certificate Authority (CA). This encrypts the\nconnection between your Docker client and Harbor registry to secure images from\nunauthorized access.\n\nBefore you begin\n----------------\n\nYou must perform these steps before managing your container\nimages:\n\n1. Install Docker if it is not already installed by following the instructions at \u003chttps://docs.docker.com/engine/install/ubuntu/\u003e. Docker is included in Cloud Shell.\n2. Docker requires privileged access to interact with registries. On Linux\n or Windows, add the user that you use to run Docker commands to the Docker\n security group. This step is not required on macOS since Docker Desktop\n runs on a virtual machine as the root user.\n\n 1. For Linux, add the user:\n\n sudo usermod -a -G docker \u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e\n\n 2. For Windows:\n\n net localgroup docker-users DOMAIN\\\u003cvar translate=\"no\"\u003eU\u003c/var\u003eSER /add\n\n Replace \u003cvar translate=\"no\"\u003eUSER\u003c/var\u003e with the username you want to add.\n\nConfigure Docker to trust Harbor Root CA\n----------------------------------------\n\nYou must configure your local Docker client to trust your organization's root\nCA when using the Docker client to communicate with the Harbor instance.\n\nTo configure the Docker client to trust the root CA, request the `.crt` file of\nthe root CA from your organization administrator, and copy the organization root\nCA to: \n\n /etc/docker/certs.d/\u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e/ca.crt\n\nReplace \u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e with the URL of your Harbor instance. For\nexample, `harbor-1.org-1.zone1.google.gdc.test`.\n\nThis command allows your Docker client to establish a HTTPS connection with the Harbor\ninstance.\n\nAlternatively, use the gdcloud CLI to sign in to any user cluster in the organization,\nand copy the web CA saved in the cluster: \n\n export REGISTRY=\u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e\n mkdir -p /etc/docker/certs.d/${REGISTRY} && \\echo $(kubectl get secret org-web-ca -n istio-system -o\n jsonpath='{.data.ca\\.crt}') | openssl base64 -A -d \u003e\n /etc/docker/certs.d/${REGISTRY}/ca.crt\n\nReplace \u003cvar translate=\"no\"\u003eHARBOR_INSTANCE_URL\u003c/var\u003e with the URL of your Harbor instance. For\nexample, `harbor-1.org-1.zone1.google.gdc.test`.\n\nIf the configuration is unsuccessful, you see the following error message: \n\n Error response from daemon: Get \"https://\u003cHARBOR_INSTANCE_URL\u003e\": x509: certificate signed by unknown authority\n\nRepeat the steps to solve this issue, and escalate to GDC engineering if\nnecessary."]]