# How can I make docker-compose pull images using a socks5 proxy?

### Method 1

Error:

```
docker-compose up 
Pulling web (jitsi/web:stable-6433)...
ERROR: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
```

then setting `HTTP_PROXY` and `HTTPS_PROXY` this way:

```
export HTTP_PROXY=socks5://localhost:9040/
export HTTPS_PROXY=socks5://localhost:9040/
```

result:

```
docker-compose up 
Pulling web (jitsi/web:stable-6433)...
stable-6433: Pulling from jitsi/web
b380bbd43752: Downloading [===================>                               ]  10.36MB/27.14MB
0312863d422f: Download complete
503063a74a58: Downloading [============================>                      ]  7.998MB/14.15MB
392a862abfe3: Download complete
41a073b705ed: Download complete
a8f4844f6941: Download complete
f500f1f2f4ae: Downloading [============>                                      ]  11.69MB/47.56MB
```

A shot of before `HTTP_PROXY` and after setting them up:

![](/files/zQfEveQ8F1o8ymZhxuT3)

### Method 2

If method 1 did not work (simple one) you can go with [this one](https://docs.docker.com/config/daemon/systemd/):

#### first

Find systemd location for configuration:

```
systemctl status docker | grep docker.service\;
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
```

which here for my on Debian 9 is `/lib/systemd/system/docker.service` and its directory is `/lib/systemd/system/`\
So `cd` into `/lib/systemd/system/`.

#### second

`mkdir` for `docker.service.d` or:

```
mkdir docker.service.d && cd !$
```

#### third

In `docker.service.d` directory create a `.conf` file like: **http-proxy.conf**

#### forth

Add these in **http-proxy.conf** file:

```
[Service]
Environment="HTTP_PROXY=socks5://localhost:9040"
Environment="HTTPS_PROXY=socks5://localhost:9040"
```

NOTE that `localhost:9040` is mine, update it if you have a different IP or PORT

#### sixth

Because we update the configuration run:

```
systemctl daemon-reload
```

and then restart docker service

```
systemctl restart docker
```

Now it is up and running:

![](/files/FH7L6ccb7KySGRgHiTH8)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shakiba.net/container/docker/how-can-i-make-docker-compose-pull-images-using-a-socks5-proxy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
