Skip to content

Proposal: add a way to specify build target by name #32104

@tonistiigi

Description

@tonistiigi

Follow-up proposal to #32063

Take the example from #32063 .

FROM ubuntu AS build-env
RUN apt-get install make
ADD . /src
RUN cd /src && make

FROM busybox
COPY --from=build-env /src/build/app /usr/local/bin/app
EXPOSE 80
ENTRYPOINT /usr/local/bin/app

When this Dockerfile is executed the last image is built and tagged. The first image is built but remains untagged and is reused for the cache. There may be cases where you want to build and tag build-env instead. In this case, it should be possible to specify the target you are interested in docker build --target=build-env ..

It the builder has finished building the block with name build-env it can stop and finish processing. Later we can make this smarter, analyze what blocks depend on each other and skip the ones that don't need to be processed.

@tiborvass @dmcgowan @simonferquel @dnephin @vdemeester @duglin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions