Michaël Blanchet
Michaël Blanchet

Reputation: 53

Creating a docker image by merging 2 images

Is there a way to merge 2 docker images into a single one? I want to setup a gitlab-ci server. For this, I need to setup a runner able to build a maven project on Java 8. There are actually an image to setup a generic gitlab-ci runner and another one that has maven and Java 8 support. If I could combine both of these images, I could easily achive my goal.

Upvotes: 2

Views: 514

Answers (2)

Michael
Michael

Reputation: 8663

You could try doing it manually, take the Dockerfile for ci-runner (found here) and change the FROM line to the maven image like this:

FROM onbuild

Then just build it.

Upvotes: 1

jacks
jacks

Reputation: 4753

There is no automated way to merge these images and many would argue that you should not really do this in any case since these images do quite different things and it's not really the way to do it.

Did you check out sameersbn's example project using the ci-runner image? You could use a similar approach to install Java and Maven.

Upvotes: 2

Related Questions