uber-archive / makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Apache License 2.0
2.41k stars 154 forks source link

multistage-build: add support for --target option #262

Closed flixpae closed 4 years ago

flixpae commented 5 years ago

Is your feature request related to a problem? Please describe. I try to build a custom ci-builder image to build container images in gitlab-ci on kubernetes

In docker or kaniko a --target option is present. i would like to control the build target in makisu in a similar way

Describe the solution you'd like a behaviour close to what the docker documentation describes https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds

Describe alternatives you've considered Build with kaniko could work but multistage-builds are tricky and kaniko is not intended to be integrated in a custom image

flixpae commented 4 years ago

Where would i need to look in the code ? maybe i can look into this a bit further ?

yiranwang52 commented 4 years ago

@flixpae you will need to look into lib/builder/build_plan.go

Can you give us an example? I want to understand why using the last stage as target wouldn't work.