Docker (11): Docker live deploy HTTPS for Tomcat site

Source: Internet
Author: User
Tags docker ps docker run

1. Select the base image

Docker Pull Tomcat:7.0-jre8

2. Generate an HTTPS certificate

Keytool-genkey-alias Tomcat-keyalg Rsa-keystore Tomcat.keystore

[Email protected]:~/ssl# ls
Tomcat.keystore

3. Launch the Tomcat container and import the certificate

[Email protected]:/usr/local/tomcat# ls/tmp/
Tomcat.keystore
[Email protected]:/usr/local/tomcat# mkdir Keys
[Email protected]:/usr/local/tomcat# cp/tmp/tomcat.keystore keys/
[Email protected]:/usr/local/tomcat# ls keys/
Tomcat.keystore

4. Commit

Do not exit container on host commit

[Email protected]:~/ssl# Docker ps-a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d3a3c7964a89 Tomcat:7.0-jre8 "bash" seconds ago up to seconds 8080/tcp Determined_mahavira

[Email protected]:~/ssl# docker images;
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
Tomcat HTTPS 5308378959ab about a minute ago 560.8 MB

5. Start and access

[Email protected]:~/ssl# Docker run--rm-ti-p 9099:8080 Tomcat:https

[Email protected]:~/ssl# Docker PS
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
532A4EF7EFCC Tomcat:https "bash" seconds ago up seconds 0.0.0.0:9099->8080/tcp Thirsty_bhaskara

Docker (11): Docker live deploy HTTPS for Tomcat site

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.