Configuring a Proxy for Logging In to the Ascend Hub
If the following information is displayed when you run the docker login xxx command on the node to log in to the Ascend Hub, the login fails.
root@ubuntu:~# docker login -u xxx -p xxx ascendhub.huawei.com WARNING! Using --password via the CLI is insecure. Use --password-stdin. Error response from daemon: Get http://ascendhub.huawei.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
The possible cause is that the proxy is not configured. To configure the proxy, perform the following steps:
- Run the following commands to create proxy configuration file proxy.conf for Docker:
mkdir -p /etc/systemd/system/docker.service.d vim /etc/systemd/system/docker.service.d/proxy.conf
- Add the following information to the proxy.conf file, set the proxy address as required, save the file, and exit.
[Service] Environment="HTTP_PROXY=http://xxxx.xxx.xxxx.xxxx" Environment="HTTPS_PROXY=http://xxxx.xxx.xxxx.xxxx"
- Run the following command to open the daemon.json file and configure insecure-registries for Docker:
vim /etc/docker/daemon.json
- If the insecure-registries field exists in the file, add the following content to the field:
ascendhub.huawei.com
Example:
{ "insecure-registries": ["xxxxxxxxxxxxxxxx", "ascendhub.huawei.com"], } - If the file does not contain the insecure-registries field, add this field.
Example:
{ "exec-opts": ["native.cgroupdriver=systemd"], # Assume that this line is the last line of the original /etc/docker/daemon.json file. After adding the insecure-registries field, you need to add a comma (,) after the square bracket (]) in this line. "insecure-registries": ["ascendhub.huawei.com"] }
- If the insecure-registries field exists in the file, add the following content to the field:
- Restart the Docker service.
systemctl daemon-reload; systemctl restart docker;
Parent topic: Common Operations