Java – docker settings

I'm reading docker today and even trying to run it on vagrant's laptop But I still don't know why, especially how to introduce it to my team I just can't see the use case

I understand that you can create containers for web servers and databases So you can say hey, now we're using the custom-tomcat-1.0 and custom-mysql-1.4 containers I created So far, it is so clear that the problems I encounter are these "data containers"

I can still understand that I update the data files of db-data-1.4 and DB container to the current architecture. I can have web-app-3.5 and my deployment, which will correspond to the DB data image in some way

How about Java? If I have a Java dB, will I need to install the JVM on all containers that use it?

What's the point so far? Now I can't see them clearly

>How do developers work locally? Will he create some web app image snapshots and start it? Or will you skip using the web app image in some way and provide the build file directly to the server image in some way? > With Jenkins, I imagine it will download code from GIT Build it and create some web application image snapshots Start everything Now I can run some integration tests that will use the application from the outside, but how?

There are basically two questions: how do you use the terminal to develop local and how to perform integration testing I need a real use case, so I can see a big picture of it We use maven, Java, spring, SQL, DB, Jenkins, JUnit

Solution

The dock factory forces you to really think about the immutable and variable parts of your application The immutable part is constructed as a basic image, while the variable part is constructed as a container (and may remain as an image)

Later, when development and testing are complete and ready for production, you may need to retest the application for the latest operating system patches and Java updates At this point, you can start with a new version of the base image and rerun the test If the test is successful, this will be the new benchmark for your build

If your database contains predefined schemas and / or preloaded data (immutable), you can design it as a data volume only and load it only on containers Any updates made to the database during the application test run will remain part of the container file system layer

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>