Docker Community Forums

Share and learn in the Docker community.

Docker Container Becomes Unhealthy Once Proxy Configured at container level

Hi,
I’ve pulled a docker image & run the container, everything is running fine. but unable to configure Proxy for container. Once I configured proxy at docker client level container can use proxy but becomes unhealthy… Can you help me how can I solve the issue.

Install docker in RHEL 8
Start docker service & configure proxy environment at docker demon

systemctl edit docker
[Service]
Environment=“HTTP_PROXY=http://IP:port”
Environment=“HTTPS_PROXY=http://IP:port”

Pull the docker Image & start docker container

  1. docker demon sucessfully use proxy to pull docker image.
  2. docker container started & running healthy but container can’t use proxy settings.
  3. unable to reach proxy port from container bash

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7b6338ac774d percona/pmm-server:2 “/opt/entrypoint.sh” 2 hours ago Up 3 minutes (healthy) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp pmm-server

Step 2: After configuring docker client.

created file ~/.docker/config.json in the home directory of root(as root starting containers).

Vim ~/.docker/config.json

{
“proxies”:
{
“default”:
{
“httpProxy”: “http://IP:Port”,
“httpsProxy”: “http://IP:Port”,
“noProxy”: “127.0.0.0/8”
}
}
}

Now craete a new container from existing image.

  1. docker container running & showing unhealthy
  2. docker container now can use proxy & reach internet.

Can you help me how can I solve container status from unhealthy to healthy ?

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8db3f16a8978 percona/pmm-server:2 “/opt/entrypoint.sh” 12 minutes ago Up 12 minutes (unhealthy) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp pmm-server-4

[root@db-monitor ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8db3f16a8978 percona/pmm-server:2 “/opt/entrypoint.sh” 12 minutes ago Up 12 minutes (unhealthy) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp pmm-server-4
[root@db-monitor ~]#
[root@db-monitor ~]#
[root@db-monitor ~]# docker logs 8db3f16a8978
WARN[2021-12-12T09:59:43.907+00:00] Configuration warning: unknown environment variable “http_proxy=http://IP:Port”.
WARN[2021-12-12T09:59:43.907+00:00] Configuration warning: unknown environment variable “https_proxy=https://IP:Port”.
WARN[2021-12-12T09:59:43.907+00:00] Configuration warning: unknown environment variable “HTTPS_PROXY=https://IP:Port”.
WARN[2021-12-12T09:59:43.907+00:00] Configuration warning: unknown environment variable “HTTP_PROXY=http://IP:Port”.
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/alertmanager.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/dbaas-controller.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/pmm.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/prometheus.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/qan-api2.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/victoriametrics.ini” during parsing
2021-12-12 09:59:44,015 INFO Included extra file “/etc/supervisord.d/vmalert.ini” during parsing
2021-12-12 09:59:44,015 INFO Set uid to user 0 succeeded
2021-12-12 09:59:44,025 INFO RPC interface ‘supervisor’ initialized
2021-12-12 09:59:44,025 INFO supervisord started with pid 1
2021-12-12 09:59:45,029 INFO spawned: ‘postgresql’ with pid 14
2021-12-12 09:59:45,031 INFO spawned: ‘clickhouse’ with pid 15
2021-12-12 09:59:45,033 INFO spawned: ‘grafana’ with pid 16
2021-12-12 09:59:45,035 INFO spawned: ‘nginx’ with pid 17
2021-12-12 09:59:45,037 INFO spawned: ‘cron’ with pid 18
2021-12-12 09:59:45,040 INFO spawned: ‘victoriametrics’ with pid 19
2021-12-12 09:59:45,042 INFO spawned: ‘vmalert’ with pid 20
2021-12-12 09:59:45,044 INFO spawned: ‘alertmanager’ with pid 21
2021-12-12 09:59:45,046 INFO spawned: ‘dashboard-upgrade’ with pid 22
2021-12-12 09:59:45,051 INFO spawned: ‘qan-api2’ with pid 26
2021-12-12 09:59:45,053 INFO spawned: ‘pmm-managed’ with pid 34
2021-12-12 09:59:45,057 INFO spawned: ‘pmm-agent’ with pid 38
2021-12-12 09:59:45,058 INFO success: dashboard-upgrade entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2021-12-12 09:59:45,103 INFO exited: qan-api2 (exit status 1; not expected)
2021-12-12 09:59:45,281 INFO exited: dashboard-upgrade (exit status 0; expected)
2021-12-12 09:59:46,276 INFO success: postgresql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: clickhouse entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: victoriametrics entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: vmalert entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,276 INFO success: alertmanager entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,278 INFO spawned: ‘qan-api2’ with pid 139
2021-12-12 09:59:46,278 INFO success: pmm-managed entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:46,278 INFO success: pmm-agent entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-12-12 09:59:47,575 INFO success: qan-api2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)