在终端中设置环境变量

export http_proxy="http://localhost:port"
export https_proxy="http://localhost:port"

取消设置:

unset http_proxy
unset https_proxy

在docker中设置代理,需要在启动时设置--net=host,使得docker共享主机的 network namespace,也就是说:容器可以直接访问主机上所有的网络信息。

docker run -itd --name test --net=host -v local:docker docker:tgz /bin/bash

 

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2021-12-28
  • 2021-05-22
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-10-22
  • 2021-09-16
相关资源
相似解决方案