Skip to content

Unable to build dockerFile without pushing it to docker server (DockerInDocker) #1197

Closed
@Beennnn

Description

Hi,

I use the docker-maven-plugin to generate a docker image from a Gitlab CI job. To achieve this I run maven inside a docker image. This docker image needs to access docker to build the image.

To avoid Docker-In-Docker (security) problems, I would like to use Kaniko as described here: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html

With this approach, I expect the docker-maven-plugin to create the DockerFile, but not to call the docker server to build the image. In fact, a second Gitlab job dedicated to Kaniko will build the image after.

The plugin configuration does not support this feature: there is no parameter dedicated to build the DockerFile without building the image itself.
I successfully achieved it patching the class named DockerAccessWithHcClient, creating a new protocol named "stub" as an alternative to unix/npipe to bypass docker server calls (see the attached file : DockerAccessWithHcClient.zip).

It would be great if this feature could be integrated to the plugin. I would greatly appreciate to discuss on this here.

Thanks,
Ben.

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions