- Bring up container:
docker run --name itx-rs -it -d -p 8080:8080 -v /itx-rs:/data itx-rs:10.0.0
- Create folder config:
cd /itx-rs
mkdir config
- Copy server.xml from container to folder:
docker cp itx-rs:/opt/server/conf/server.xml /itx-rs/config/
- Generate Self-Signed Key:
keytool -genkey -alias itx-rs -keyalg RSA -keystore /itx-rs/config/keystore.jks
- Add this to server.xml to enable HTTPs.
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="http" secure="true"
SSLEnabled="true"
keystoreFile="/opt/server/conf/keystore.jks"
keystorePass="password"
clientAuth="false" sslProtocol="TLS"/>
- Make sure both server.xml and keystore.jks are readable, if not set it with chmod.
- chmod u=rwx.g=rx.o=r server.xml
- chmod u=rwx.g=rx.o=r keystore.jks
- Bring up container with additional parameters:
docker run --name itx-rs -it -d -p 8080:8080 -p 8443:8443 -v /itx-rs/config/server.xml:/opt/server/conf/server.xml -v /itx-rs/config/keystore.jks:/opt/server/conf/keystore.jks -v /itx-rs:/data itx-rs:10.0.0
- Test:
- curl -X PUT -d "This is a test" "http://localhost:8080/itx-rs/v1/maps/direct/OneInOneOut?input=1&output=1"
- curl -X PUT -k -d "This is a test" "http://localhost:8443/itx-rs/v1/maps/direct/OneInOneOut?input=1&output=1"
- TroubleShooting by viewing:
docker logs itx-rs
ITX Container Runtime
--------------------------------
Using HTTPs in 10.0.1 Certified Container
--------------------------------------------