I use monitoring application "ManageIQ" inside Docker container with the ssl port to check the application "hawkular" which is located outside the Docker container. Below are the docker commands:
docker pull manageiq/manageiq:euwe-2
docker run --privileged -d -p 8443:443 manageiq/manageiq:euwe-2
And I configure the ssl setting inside the "ManageIQ" docker container
docker exec -ti "container-id" bash –l
[root@17a6a6bd8743 vmdb]# vi /etc/httpd/conf.d/ssl.conf
ServerName localhost:8443
SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2
SSLCertificateFile /opt/manageiq/manageiq-ui-service/node_modules/browser-sync/lib/server/certs/server.crt
SSLCertificateKeyFile /opt/manageiq/manageiq-ui-service/node_modules/browser-sync/lib/server/certs/server.key
[root@17a6a6bd8743 vmdb]# systemctl restart httpd
[root@17a6a6bd8743 vmdb]# yum install firewalld -y
[root@17a6a6bd8743 vmdb]# systemctl start firewalld
[root@17a6a6bd8743 vmdb]# systemctl enable firewalld
[root@17a6a6bd8743 vmdb]# firewall-cmd --add-service=https --permanent
success
[root@17a6a6bd8743 vmdb]# firewall-cmd --reload
success
The ManageIQ web application https://localhost:8443 works succesfully. But can't connect to hawkular whose URL is http://localhost:8080 located outside the Docker container.
These 2 applications have each different "localhost", however I have no idea how to handle this problem. Do I miss any process to solve this issue?
localhostin acontaineris notlocalhoston host OS. these are different.To connect the address of host OS from a
container, usedocker0interface which is defaultbridge networkdocker serves by default. (Of course, you could create your own docker network other than default bridge network, refer here)For example, If
docker0interface's IP is172.20.0.1, Use172.20.0.1:8080.