Настраиваем прокси сервер на платформе Docker

Настройка прокси сервера может потребоваться на платформе Docker в ряде случаев. Самыми распространёнными являются обход лимитов веб-провайдера и проведение тестов разработанного вами ПО во многих геолокациях. Начнём с рассмотрения понятия Докера.

Олександр Л.
Preview

Олександр Л.

11 June 2025

920

920

11 June 2025

What Is Docker

Docker is a suite of products implemented on the "platform as a service" (PaaS) principle, utilizing OS-level virtualization to deliver software in packages called containers, that is, to perform containerization of packages. The service offers different payment tiers: free and premium with extended features. This software was released in 2013. In other words, Docker is a platform for developing, delivering, and running applications, where you can separate your software from your infrastructure. Thus, a built container can be run on various operating systems. Additionally, you will be pleased to learn that the Docker platform supports SSL, providing excellent data and network security, especially when testing applications. Containerized information includes:

  • The software itself that needs to be run by the developer;
  • The runtime environment — a virtual machine with the minimal necessary processes;
  • Files required for running the software;
  • Server.

StableProxy

Whether you need anonymous proxies, premium business solutions, or just want to buy cheap proxies — we have it all.


Setting Up a Proxy in Docker

There are 2 ways to configure it: via the command line and using a config file. The command line procedure looks like this:

  1. Since you will use the parameter proxy.example.com:Port, you need to find out the IP address of your proxy and the port being used.
  2. In the command line, write the command docker build, which creates the config. You need to use the --build-arg argument. The full command will look like this:
    docker build --build-arg HTTP_PROXY="http://proxy.example.com:Port"
  3. Then, in the same command line, enter the docker run command to start the created config. It is necessary to use the --env argument. The full command will look like this: docker run --env HTTP_PROXY="http://proxy.example.com:Port" redis Configuring Docker proxy via a config file looks like this:
  4. In your working directory, find the .docker folder. It should contain a file named config.json. Create it if missing.
  5. In the file, using your preferred code editor, enter the following lines:
{ 
"proxies": { 
"default": { 
"httpProxy": "http://proxy.example.com:Port", 
"httpsProxy": "https://proxy.example.com:Port", 
"ftpProxy": "https://proxy.example.com:Port", 
"noProxy": "*.test.example.com,.example.org,127.0.0.0/8" 
} 
} 
} 
  1. Instead of proxy.example.com:Port, enter your IP address and port details, similarly to the example with the command line.
  2. In the config file, as shown in the code above, you can use 4 proxy options:
  • HttpProxy — for HTTP without encryption;
  • HttpsProxy — for HTTPS with encryption;
  • ftpProxy — for FTP for file transfer;
  • noProxy — for directing traffic directly. Similar proxy options should be used when working with the command line, depending on your proxy setup. After saving your docker proxy config file, the information you entered will be applied to all new containers and to existing containers loaded from the Docker repository.

Frequently Asked Questions

Where to Buy Proxies in Ukraine?

The choice is obvious: stableproxy.com. We have an office and pay taxes in Ukraine. Our real servers are located on the territory of our country, ensuring you the highest quality and comfort.

For What Purposes Are Proxy Servers Used?

Advantages of purchasing a proxy in our store

Residential Proxies

Mobile Proxies

Private Proxies

How to Get Started?

StableProxy

StableProxy

© StableProxy – 2021 - 2025 – Ukraine

Payment methods