Docker Community Forums

Share and learn in the Docker community.

Cyclos Docker SSL Impelementation for tomcat

I have configured tomcat inside docker container as follows

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
            <Certificate certificateKeystoreFile="my.jks"
                         type="RSA" />

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
                <Certificate certificateKeyFile="/etc/letsencrypt/live/"
                         type="RSA" />

Restarted the docker container but its not accessible via https

where my.jks is stored inside tomcat/conf directory.

I configure docker container as follows:

docker run -d \
    --name=nameofcontainer \
    -p 80:8080 \
    -p 443:8443 \
    --net=cyclos-net \
    --cap-add=NET_ADMIN \
    -e DB_HOST=cyclos-db \
    -e DB_NAME=cyclos \
    -e DB_USER=cyclos \
    -e DB_PASSWORD=cyclos \

check inside the container on which network ip the port is attached. using netstat -ntlp. If it is not set or bridge network ip, please do that. as port mapping happens to bridge interface ips only( host can access bridge interface port service only).

root@4b0535d06a77:/usr/local/cyclos# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0*               LISTEN      -
tcp        0      0*               LISTEN      1/java
tcp        0      0  *               LISTEN      1/java
tcp        0      0  *               LISTEN      1/java
tcp       24      0  *               LISTEN      1/java

it looks good
did you try telnet to that port from host. to see if are you able to connect to that port.
If yes then check the tomcat server log what is going on

Microsoft Telnet> o 8443
Connecting To…Could not open connection to the ho
st, on port 8443: Connect failed

which log file to see

root@9aeaabef6e66:/usr/local/tomcat/logs# ls
catalina.2019-05-14.log localhost.2019-05-16.log
catalina.2019-05-15.log localhost_access_log.2019-05-14.txt
catalina.2019-05-16.log localhost_access_log.2019-05-15.txt
host-manager.2019-05-14.log localhost_access_log.2019-05-16.txt
host-manager.2019-05-15.log manager.2019-05-14.log
host-manager.2019-05-16.log manager.2019-05-15.log
localhost.2019-05-14.log manager.2019-05-16.log