[英]How can i run java applications in docker using apache or tomcat server
I am new to docker. 我是码头工人的新手。 I want to run my java application on tomcat server using docker images/containers.
我想使用docker images / containers在tomcat服务器上运行我的java应用程序。 Can anyone suggest best method to do that?
谁能建议最好的方法来做到这一点?
First find a docker image with the version of tomcat you want. 首先找到你想要的tomcat版本的docker镜像。 You can search docker images using,
docker search
so try 你可以使用
docker search
搜索docker图像,试试吧
docker search tomcat
next pull it locally 接下来把它拉到本地
docker pull <your/image>
then run commands on it to install your software 然后在其上运行命令来安装您的软件
docker run <your/image> <your command and args>
then find your container ID by running 然后通过运行找到您的容器ID
docker images
and commit you changes 并提交你的变化
docker commit <container_id> <some_name>
I'd recommend the docker tutorial to get started. 我建议开始使用docker教程 。
PS this answer will show you how to transfer files to docker. PS 这个答案将向您展示如何将文件传输到docker。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.