gitlab docker runner mvn: command not found

I am trying to build ci/cd withing gitlab runner docker image

build: script: - mvn install

but I face below error

$ mvn install bash: line 85: mvn: command not found

@ahmedyosry963 welcome to the forum! :wave:

In order to use Maven, you’ll need to select a Docker image to build inside of that has Maven included. To do that add an image: tag to your .gitlab-ci.yml. For a list of “official” Maven images, you can see the Maven listing on Docker Hub, as it will depend on the version of Java you are building for.

But in the end you’ll add something like this:

image: maven:3.6.3-jdk-11

You can also see a full working .gitlab-ci.yml example for Java here.