rainbond
rainbond copied to clipboard
Use Case: How to enable Buildkit when building docker image from source code
The requirements?
Enable Buildkit
when building docker image from source code
Way:
https://docs.docker.com/engine/reference/builder/#buildkit
sorry, not support buildkit. Rainbond v5.9.x pipeline feature will support custom builds
Which features of BuildKit do you think attract you?
Currently, the source code build is built using buildpack. You can refer to this project: https://github.com/goodrain/builder
If you mean Dockerfile build, In the v5.9.0 version of Rainbond, Dockerfile build is no longer dependent on Docker, https://github.com/GoogleContainerTools/kaniko is used by default to build
@yangkaa I want to use the feature of https://docs.docker.com/engine/reference/builder/#run---mount to speed up building.
RUN --mount=type=cache,target=/root/.m2 ./mvnw install -DskipTests
Unfortunately, with reference to this https://github.com/GoogleContainerTools/kaniko/issues/1568, we may not support this feature in the short term.
But you might have an alternative, Buildah already supports this feature. refer: https://github.com/containers/buildah/issues/3452, Podman uses buildah to build images.
So you can customize your CI process and use Podman to build the image. On Rainbond, use mirrors to build your component. When your code is submitted, the CI process is triggered and the image built by Podman is pushed to the repository. Finally trigger the construction of Rainbond image.