Comments (3)
Hi @n-g-work ,
The order of Push and Kaniko steps are not connected with the resulting .jar files that appear in the Docker image.
The Push step just deploys everything what's in the 'target' folder after the Java application build to Nexus.
In turn, the Kaniko step takes the Dockerfile commands and pushes everything to the registry according to those instructions.
You can examine our pipelines here: https://github.com/epam/edp-tekton/blob/v0.5.0/charts/pipelines-library/templates/pipelines/_common_java_maven.yaml
We intentinonaly do not include any sort of file ignores in our Pipelines and Tasks since each unique application can produce different build results.
Threre are several options to avoid unnecessary .jar files to be included into the Docker image:
- It's .dockerignore like you already mentioned in this issue.
- The COPY instruction can be modified in the Dockerfile directly.
- It's also possible to ingnore files via pom.xml file.
from edp-tekton.
I can't disagree that using a .dockerignore
file is a solution. I have only one problem with this.
It is considered a best practice to place .dockerignore
file in the root directory of a project, and currently the pipeline ignores it in case of a Maven multimodule project.
For multimodule projects the file must be placed into the folder which corresponds to the value in the <deployable.module>
tag. And exactly this file location requirement is confusing.
I would consider the issue resolved if the pipeline takes into account the .dockerignore
file in the project's root directory.
from edp-tekton.
@n-g-work I see your point.
I experimented a little bit and came up with two solutions.
- Use
Dockerfile.dockerignore
instead of.dockerignore
with this content:
target/*-sources.jar
This file is picked up by the Kaniko runtime along with the path to the Dockerfile.
- The second solution is to modify
java-maven-springboot-multimodule-impl/pom.xml
and add a custom output folder like it's described here: https://maven.apache.org/plugins/maven-source-plugin/examples/configureplugin.html
<configuration>
<outputDirectory>target/sources</outputDirectory>
</configuration>
Feel free to check this example: https://github.com/epmd-edp/java-maven-java17-multimodule
from edp-tekton.
Related Issues (20)
- Enable Code Owners for project
- Exclude tekton PipelineRun from Resources Displayed in ArgoCD to avoid diff
- Use recreate strategy in tekton-cache Deployment
- fix: chart can create multiple eventListeners route
- Align charts for ingress TLS configuration
- Update tekton-dashboard version
- Bump to go 1.22
- Failed build pipeline for helm app and lib on helm-push step
- Investigate and Fix Multiple Pipeline Runs on PR Rebase
- Bump hadolint version to v2.12.0
- Implement Quality Gate for Helm Chart Name Alignment with Codebase Name
- Make possible use PR commit message in pipelines
- Resolve Version Conflict Between h11 and httpcore in FastAPI Codebase
- Update Commit-Validate Step to Use Commit Title for Validation
- Deployment process fails at 'init-autotest' stage
- Node.js Version Incompatibility in Build and Review Pipelines
- Update CodeQL Scan to Use Latest GitHub Actions in edp-tekton Repository
- Rewrite the edp-tekton pruner logic
- Default Branch Misconfiguration in New Sonar Project Creation
- Release edp-tekton 0.2.18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edp-tekton.