HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议,要比HTTP协议安全。
教程以阿里云为例
备案域名后申请免费证书

购买证书

选择Symantec > 免费型DV SSL

下载证书,以tomcat为例

以「Spring Boot」 推送Docker镜像到阿里云镜像服务项目代码为基础,新建spring-boot-docker-ssl项目

配置application.properties
server.port= 8099
server.ssl.key-store= classpath:cert-1537941630836_www.aprcode.com.pfx
server.ssl.key-store-password= MOi6arPC
Docker打包和推送请参考上两篇文章:
「Spring Boot」 Docker打包镜像
「Spring Boot」 推送Docker镜像到阿里云镜像服务
在服务器上登录镜像仓库获取最新镜像,并启动。
[root@izwz99u47743ten25slpjpz ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.cn-hangzhou.aliyuncs.com/aprcode/aprcode aprcode.2.0.0 279964124c46 14 minutes ago 119MB
registry.cn-hangzhou.aliyuncs.com/aprcode/aprcode aprcode.1.0.0 671bc04fb203 6 hours ago 119MB
访问https://www.aprcode.com:8099/
https://www.aprcode.com:8099/
欢迎关注我的公众号,跟我留言。

博客地址:Spring-Boot-Docker-Aliyun
教程源码Github地址:Spring-Boot-Docker-Aliyun
教程源码Gitee地址:Spring-Boot-Docker-Aliyun
1169

被折叠的 条评论
为什么被折叠?



