I want to create image of docker in gitlab CICD with jdk-8 python 3.9 and maven how can i do itcurrently i am using
image: maven:3.3.9-jdk-8
cache:
paths:
- ".m2/"
i want to include python in the runner
Unless you're able to find another image that fits your needs, it looks like you need either create a new image and run from that, or you need to install python3 as part of your preparation steps.
The benefits of building your own image are that you don't have to wait for the installation process every time your CI runner runs, leading to faster compiles and lower costs. In addition, you can build and test that image ahead of time, so you limit any variables that might contribute to build failures based on an externality or failed package install.
Either way, you're going to be looking at adding install steps in your gitlab CI, either when you build an image or before running the steps in the maven container.
Add something like this:
- apt-get update
- apt-get install -y --no-install-recommends python3.9
early in your your script:
.
These steps update the distribution's package manager and then install the python3 interpreter (the --no-install-recommends
isn't necessary, but it can reduce the amount of additional installation that is done unnecessarily).