I am using maven-docker-plugin in my project. This plugin will create docker containers during integration tests. Since drone.io put the build process inside a docker container, whether I can still use maven-docker-plugin during maven build? How to control the docker containers during build time?
Whether drone.io support creating docker during build process
682 views Asked by Joey Yi Zhao At
1
If you want interact directly with the Docker daemon to create and start containers, you need to mount the host machines Docker socket into your build container.
Since you mentioned using the docker-maven-plugin you may want a configuration similar to the following:
Please note that exposing the Docker daemon to your build environment is essentially giving your build root access to your server. This approach is therefore not recommended for public repositories.
Please also note that volumes are restricted security reasons. To use volumes you need to have a Drone administrator mark your repository as trusted, in your repository settings screen.
So it is possible to launch containers from inside the build environment for the purpose of running your tests. The recommended approach, however, is to run your tests directly inside your build environment. This is the use case for which Drone is optimized, and it eliminates the security issues mentioned above.