smartrecruiters / docker-bakery Goto Github PK
View Code? Open in Web Editor NEWDockerfile hierarchy management tool with automatic rebuilding of dependent images when parent changes
License: MIT License
Dockerfile hierarchy management tool with automatic rebuilding of dependent images when parent changes
License: MIT License
Hey,
for my use case I'm including the current branch name within the generated image name. So I use something like FROM {{.DEFAULT_PULL_REGISTRY}}/base/{{.BRANCH}}:{{.BASE_VERSION}}
in child images (Full minimal testcase). When determining the hierarchy, this property does not seem to be evaluated properly:
$ docker-bakery build -s major -c config.json -d base/Dockerfile.template -p BRANCH=master
Dockerfiles hierarchy discovered in .
├── scratch
│ └── base
└── {{.BRANCH}}
└── child
As a result, only base
gets build, because child
is not being determined as a child of base
.
We are interested in using this tool for our internal use case. However, we found one thing that we would like to have in a different way. Currently, the folder name where the Dockerfile.template
is located is used as the IMAGE_NAME
. Let me explain it using your example repo. You have the following structure:
├── alpine-java
│ ├── bird (latest: 0.0.1)
│ └── mammal (latest: 3.2.5)
│ ├── cat (latest: 5.0.4)
│ ├── dog (latest: 5.0.4)
│ │ ├── dobermann (latest: 4.0.4)
│ │ │ └── smaller-dobermann (latest: 4.0.4)
│ │ ├── pitbull (latest: 3.0.4)
│ │ └── labrador (latest: 9.0.4)
│ └── horse (latest: 3.2.4)
└── scratch
└── fish (latest: 1.0.0)
Right now all the images have the following name structure: {{.DEFAULT_PULL_REGISTRY}}/<name>:<version>
. However, we want a nested structure, an example for dobermann
would be: {{.DEFAULT_PULL_REGISTRY}}/mammal/dog/dobermann:<version>
. I think this solution is more verbose than having to define folder names like mammal-dog-dobermann
to achieve something similar. As well, if 2 directories have the same name but different parents, the current approach would cause issues.
Is this something you could add support to? Or is this project not maintained anymore?
If this is something you would accept I can create a pull request for it
Hi!
I am trying to use docker-bakery in my CI/CD pipelines. The goal is to, whenever someone merges to master, build only the images that changed, and their children, avoiding building the children twice if both the parent and the children changed.
This is easy locally, because you know which files you edited, so you just go to those and run the build command. In the CI/CD (I'm using Gitlab), I can list all the Docker.template
files that changed since the last merge, but I still need to find a way to avoid building parent and child if both changed. My idea was to use the show-structure
command and filter using that, but the output is very difficult to parse. I think adding a json output option would be very useful.
I also tried using the images' digests to detect if something changed or not, but those change every time, even if the image is exactly the same, I think this happens because of the BAKERY_BUILD_DATE
env variable that changes every time automatically.
I am also open to suggestions as to how automate this. Maybe I am just doing everything wrong! 😄
Thank you in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.