Skip to content

Reference part of multi-stage build #5191

Closed

Description

@tomwidmer

Currently, when specifying a build in a compose file there's no way (that I know of) to reference a particular target in a multi-stage build.

You might want to do this if you are using compose for running a local development stack. If an early stage of your build pipeline sets up an image that is suitable for live-development purposes (as well as build), but the later stage(s) crunch it down to a minimal production image, so you can't use the Dockerfile for your live-dev image. Currently, you might instead create 2 docker files, which is more complex and worse to manage.

Adding a 'target' yml arg to build would resolve this, as per docker build. e.g.
Dockerfile:

FROM debian AS build-env
...

docker-compose.yml:

myservice:
  build: .
    target: build-env

Activity

  1. tomwidmer commented on Sep 15, 2017

    @tomwidmer
    Author

    Actually, I can see that this appears to be supported already (possibly not released yet): #5011

    Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions