Skip to content
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

Docker multi-stage builds? #68

Open
laugimethods opened this issue Jun 20, 2017 · 6 comments
Open

Docker multi-stage builds? #68

laugimethods opened this issue Jun 20, 2017 · 6 comments

Comments

@laugimethods
Copy link

Do you plan to support Docker multi-stage builds?
That feature might be easier to implement if Use a Dockerfile #56 is released...

Btw, thank you indeed for your plug-in.

@marcus-drake
Copy link
Owner

Multi-stage builds is an interesting feature, not sure how many would benefit from it. I'm not using it myself which makes it harder to build and maintain, but a PR for it would be welcome 😄

@AlexBaitov
Copy link

+1

@skonto
Copy link

skonto commented Oct 30, 2019

@marcuslonnberg is this still true? There is no support for multi-stage builds? Would that be a lot of effort? This is a very useful feature nowadays.

@tpeikert
Copy link

+1

@jguitana
Copy link

@marcuslonnberg I was able to make multi-stage builds work with the following code.

  case class CopyMultiStage(from: String, src: String, dest: String) extends DockerfileInstruction {
    override def arguments: String = s"--from=$from $src $dest"
    override def instructionName: String = "COPY"
  }
ImmutableDockerfile
  .empty
  .from(s"${image.value} AS $multistageName")
  .run(... do a bunch of stuff ...)
  .from(otherImage.value)
  .addInstruction {
   CopyMultiStage(
     multistageName,
     copySomethingFromPreviousStage,
     copySomethingToNextStage
     )
  }
  .entryPoint(...)

Is this something we can add easily to the plugin?

@marcus-drake
Copy link
Owner

@jguitana I've now clarified in the readme how to handle instructions that are not currently directly implemented by the DSL. The new method is available in version 1.9.0.
I hope that this works for your case 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants