在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):fabric8io/shootout-docker-maven开源软件地址(OpenSource Url):https://github.com/fabric8io/shootout-docker-maven开源编程语言(OpenSource Language):Java 82.7%开源软件介绍(OpenSource Introduction):Docker Maven Plugin ShootoutThis is a sample project for exercising various Docker maven plugins. The focus is on the most active docker maven plugins, namely:
Of course, this shootout is biased. And since we know our plugin the best, the configuration for the
A Micro-ServiceThis project contains of a very simple Micro-Service, which accesses a Postgres database. The purpose of this micro service is to simply log every access in the database and return the list of all log entries. In addition, a simple integration test checks this behaviour. The database schema is created with Flyway. This setup consist of two images:
Both containers from this image are docker linked together during the integration test. Running the shoot-outEach plugin is configured in an extra Maven profile: $ mvn -Pfabric8 clean install ResultsThe following sections summarizes some results while developing and running the examples. Of course, they can change over time when new releases happen. Please feel also free to send pull requests for things which you consider to be wrong or corrected. And of course, the results are somewhat biased ;-) fabric8io
The fabric8 plugin uses a configuration section for all images to maintain. It has config section for
each section, which is divided in a build and run part for building instructions and rumtime configuration,
respectively. The service image dynamically adds files as described in the assembly descriptor
To build the images:
To create containers and start them:
Calling
will perform all the above plus more: Create images, start container, run unit tests, stop containers, cleanup. Some features:
wouterd
The wouterd plugin uses different configuration sections for building and running images. For building images every file (including the Dockerfile itself) must be referenced. To build the images:
To create containers and start them:
Calling
will perform all the above plus more: Create images, start container, run unit tests, stop containers, cleanup. Some limitations:
alexec
The alexec plugin uses external configuration below src/main/docker where each subdirectory specifies an extra image. To build the images:
To start the images:
Run integration tests:
The host exposed with ${docker.log-service.ipAddress} is not routable outside the host running
the Docker daemon so when running a setup with a VM like Boot2Docker or docker-machine then the
test would need to run within this VM. Hence the integration test code has a workaround to use
the ${DOCKER_HOST} in this case. See Other limitations:
spotify
Since this plugin can be only used to build an image. Also we need to use the Dockerfile mode because we want to export a port (which is not possible with the simple configuration) Build the image with:
You can run the image but need to link the postgres image properly:
Finally you can run the integration test:
(replace 49162 with the dynamic port as shown by "docker ps" and "localhost" with the your docker host) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论