I am building a docker image inside gitlab runner. So, I am using docker:latest image, because I need to push the image to the registry, but before building the image, I need to package my java project. How to use docker image with maven to build project?
Right now, gitlab runner returns an error
$ docker run -it --rm -v "$(pwd)":/opt/maven -w /opt/maven maven:3.3.9-jdk-8 mvn clean install
the input device is not a TTY
ERROR: Job failed: exit code 1
You don't need (and cannot) run the container as interactive nor allocate a TTY there in Gitlab. So remove the -it from your docker run:
docker run --rm -v "$(pwd)":/opt/maven -w /opt/maven maven:3.3.9-jdk-8 mvn clean install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With