Technology Sharing

How to configure Docker environment with accelerator in Ubuntu environment

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

1. Install and open the accelerator

This needs to be installed and opened according to the situation of each accelerator. Generally, a proxy port will be opened, such as 1087

2. Install Docker

https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script

3. Configure Docker to use the accelerator

3.1 Modify configuration

  1. 打开vim /etc/systemd/system/multi-user.target.wants/docker.service
  2. Modify the file
    Add the following configuration:
Environment=HTTP_PROXY=http://localhost:1087
Environment=HTTPS_PROXY=http://localhost:1087
Environment=NO_PROXY=localhost,127.0.0.1
  • 1
  • 2
  • 3

insert image description here

3.2 Restart Docker

systemctl daemon-reload
systemctl restart docker
  • 1
  • 2