Links

Configuring an HTTP Proxy

This page explains the process for configuring and testing an HTTP proxy for Linux Docker daemon using ~/.docker/config.json to ensure that the on-prem instance is able to communicate.

Prerequisites

Before proceeding with the configuration, the following tasks must be completed and in place:
  • the host for the PlexTrac instance
  • Docker installed and running
  • access to edit ~/.docker/config.json file
  • a valid HTTP proxy server

Installation Instructions

Step 1: Configuring the HTTP Proxy

a. Open the ~/.docker/config.json file using preferred text editor.
b. Add the following JSON object to the file:
{ "proxies": { "default": { "httpProxy": "http://proxy-server:port", "httpsProxy": "http://proxy-server:port", "noProxy": "localhost,127.0.0.1" } } }
  • Replace "proxy-server" and "port" with the appropriate values for your proxy server.
  • The "noProxy" field is optional and can be used to specify a comma-separated list of domains that should be excluded from the proxy.
c: Save changes and close the file.

Step 2: Restarting the Docker Daemon

a. Open a terminal window.
b. Run the following command to stop the Docker daemon: sudo service docker stop
c. Run the following command to start the Docker daemon: sudo service docker start

Step 3: Testing the HTTP Proxy

a. Open a terminal window.
b. Run the following command to check the current proxy settings:docker info | grep -i proxy
c. The output should show the proxy server and port that you have configured in the ~/.docker/config.json file.
d. Run the following command to test the proxy if desired:docker pull ubuntu:latest
  • If the command completes successfully, it means that the Docker daemon is able to communicate with the internet via the proxy server.
Any modifications to the ~/.docker/config.json file will require a restart to the Docker daemon for the changes to take effect.
© 2022 PlexTrac, Inc. All rights reserved.