简体   繁体   English

在docker中保留数据-在docker中保留websphere应用程序

[英]persist data in docker - persist websphere applications in docker

I'm a beginner with docker... 我是docker的初学者...

I'm able to run a docker image with websphere and deploy a simple java application in it (just to test it). 我能够在Websphere上运行docker映像并在其中部署一个简单的Java应用程序(只是对其进行测试)。

docker run --name test -h test -p 9043:9043 -p 9443:9443 -d ibmcom/websphere-traditional

the container stars correctly so i can deploy my application through the whebsphere console. 容器正确启动,因此我可以通过Whebsphere控制台部署应用程序。

When i stop the container, obviously, the data that i've putted in the websphere are lost. 当我停止容器时,很显然,我放入Websphere中的数据会丢失。

docker stop test   
docker rm test

with docker stop test only, the data are not lost, but i need to switch off the docker machine at all( docker-machine stop , mine is a developer enviroment). 仅使用docker stop test ,数据不会丢失,但是我需要完全关闭docker机器( docker-machine stop ,我的是开发人员环境)。

So i've tried to start the container with a volume.... 所以我试图用一个容器启动容器。

docker run --name test -h test -p 9043:9043 -p 9443:9443 -d --mount source=myfirstvolume,destination=/myfirstvolumemounted ibmcom/websphere-traditional

bui i imagine, this isn't enough to permit the container to keep the application that i've installed in 我想,这还不足以允许容器保留我安装的应用程序

When you docker run a container, you are creating an instance of that container from the specified image and starting it. docker run容器时,您将从指定的映像创建该容器的实例并启动它。 Once you've created the container, you can simply docker start and docker stop the WebSphere App Server container without losing any of the WAS data that you've saved to the configuration repository, just as if you were running WAS outside a container. 创建容器后,您可以简单地docker startdocker stop WebSphere App Server容器,而不会丢失已保存到配置库中的任何WAS数据,就像在容器外部运行WAS一样。 If you install an application to WAS and save the configuration, that application will still be installed after stopping and restarting the container. 如果将应用程序安装到WAS并保存配置,则在停止并重新启动容器后仍将安装该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM