-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: Build local docker image #1175
Comments
Actually, thinking about it again, this should be possible with the docker plugin and a Dockerfile in the repo. Certainly not as convenient to configure as above but I think it'd probably be a lot of work to support this in woodpecker as it has no registry, for example. |
let's collect cache proposals and then decide ... but that will not be in next release ... |
This would be an absolute 'killer' feature and I would love to have it. My current workaround is to have a separate repo of dockerfiles and have CI which publishes those to a private registry, but it's so clunky and it means that my project repos aren't self-contained. CI performance would be much much faster if I could define an image within the Woodpecker YAML that would be built as needed and cached otherwise, precisely for installing packages or compiling build tools... :) |
Maybe woodpecker server could provide temporary docker registry for docker build images? This would also allow testing built images in separate pipeline and starting them as services. There could be option on how long images in that registry should be kept either only as long as pipeline is running (temporary) or deleted when not used anymore for some period of time |
Yeah, I guess an option like |
Yes but would be nice if that could be specified somehow also in pipeline (with having setting for default value if not specified) |
well docker does allow to create a "snapshot" of a running container ... so we could just snapshot a step after exec before stop it and store that, and on next run check if there is already a snapshot. TODO: are there similar concepts for the kubernetes and podmak backend(s)? |
Updated syntax suggestion in OP slightly to allow multiple images to be built. |
This feature would be really useful. Why not use the docker compose syntax:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Something like this could potentially be useful for building docker image for services |
The documentation hinted it might be possible : https://woodpecker-ci.org/docs/usage/volumes A working example :
|
This is just a workaround, not a solution:
|
Yep but depending on your setup this might be an acceptable workaround so I thought it was worth mentioning. |
Add some documentation on how to build then use a local `Docker` image. It's hinted in the [Volumes](https://woodpecker-ci.org/docs/usage/volumes) doc, but I think it's worth to make it more visible. Relates to #1175.
I came here looking for something similar to the steps:
- name: build
dockerfile: Dockerfile.ci
commands:
- meson # ... Where the container image would then be built and used to run the commands. With the build cache it's highly efficient when running pipelines repeatedly on the same host, and still pretty good with only a few (when spreading over many hosts an internal registry might indeed be better). I personally don't see a need to have a context other than an empty directory (anything from the repository should be available from the workspace during |
Clear and concise description of the problem
Docker-based CI systems have an inherent flaw that it's not possible to pre-define an environment for steps/pipelines, so system-wide tools/languages have to be installed again and again into individual steps/pipelines which is a waste of resources and time.
Suggested solution
The CI could provide the ability to build docker images that are only available locally on the system, keyed and cached on the resulting image
name
. Build should be skipped if an image with the name already exists on the system.In a file outside of pipelines:
Pipeline using the built image:
Alternative
The alternative is to create and publish these images to a docker registry, but this brings a lot of extra burden in keeping these images up-to-date which many are not willing to do.
Validations
The text was updated successfully, but these errors were encountered: