Dockerfile is successfully build in CICD pipeline but its not running
This is cicd pipeline screenshot
Related
I configured a self-hosted agent which is a k8s pod. When I use it in a pipeline the maven build stage fails. But when I exec into the agent and run the same command that starts with /usr/bin/mvn -f /azp/_work/2/s/pom.xml inside the agent it works without an error.
What am I missing here?
Thanks
8.1
I'm able to build my container image with Jib running: ./gradlew clean build -Dquarkus.container-image.build=true
And then I can run it with docker run
The container built is running using the production profile.
I have a separate dev/staging container environment, where I can actually deploy and obviously the configs for passwords and domains are different.
Is there a way to specify the profile during the container build, so for example when it runs it uses the dev profile configurations?
This did the trick:
./gradlew clean build -Dquarkus.container-image.build=true -Dquarkus.profile=dev
How can I create a Java(Maven) Application as a CICD Project on gitlab with windows and with a shell runner. Is it right manner? When I search this subject, I see a java/CICD Project or a Maven/CICD Project , but not a CICD Project where the java aplication which build within maven.
Here an example that how you can;
image: adoptopenjdk/maven-openjdk11
build:
script: "mvn clean install"
I need to know why in my jenkins pipeline when creating a docker container for building a java app with maven everytime that I run the pipeline it downloads all the java artifacts/requirements again and again from the pom.xml file,, help please!
Because the directory, where maven caches these artifacts (~/.m2) is inside the docker container and thus not preserved between runs.
We are using TFS in our organisation and we manage our whole build through shell scripts (which isn't great)...
Our agent have docker installed and we run our build script inside docker. We have several images for maven, gradle, NodeJs, ...
Because of our use of Docker we cant use the maven plugin for example.
I am wondering if I can somehow benefits from the maven plugin while still running on docker?
You could directly use Docker Integration instead of managing build through shell scripts.
The Docker extension adds a task that enables you to build Docker
images, push Docker images to an authenticated Docker registry, run
Docker images or execute other operations offered by the Docker CLI.
It also adds a Docker Compose task that enables you to build, push and
run multi-container Docker applications or execute other operations
offered by the Docker Compose CLI. Lastly, it offers a Docker Deploy
task that enables you to deploy single Docker images or
multi-container Docker applications into Azure.