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

Changing order of RUN vs COPY? #377

Closed
andyshinn opened this issue Feb 5, 2016 · 8 comments
Closed

Changing order of RUN vs COPY? #377

andyshinn opened this issue Feb 5, 2016 · 8 comments

Comments

@andyshinn
Copy link

I don't think it is currently possible to do so. But I'd like to have some of my RUN commands happen before the COPY. My use case is for package management and dependencies that don't change that often. Right now, the COPY happens first and invalidates the cache of those RUN, which causes them to be done again. Those are costly steps in terms of bandwidth and time.

I wonder if it makes sense to allow multiple runCmds sections and move the optimize to it as well. It could look something like:

<runCmds>
  <beforeCopy>true</beforeCopy>
  <run>apt-get -q update</run>
  <run>apt-get -qy install mypkgs</run>
  <optimise>true</optimise>
</runCmds>
<assembly>...</assembly>
<runCmds>
  <run>java -jar my.jar setupotherstuff</run>
</runCmds>
@jgangemi
Copy link
Collaborator

jgangemi commented Feb 5, 2016

this might be better suited to an external Dockerfile, would that work for you?

@andyshinn
Copy link
Author

Probably. I read in another issue that the assembly stuff may be working with a custom Dockerfile soon. Is there any examples of that currently?

@jgangemi
Copy link
Collaborator

jgangemi commented Feb 5, 2016

could you be a little more specific or point me to that specific issue? i'm not sure what you're referencing.

@jgangemi
Copy link
Collaborator

jgangemi commented Feb 5, 2016

i don't think so - if you have questions on what you need to do to make the assembly work, feel free to ask.

@rhuss
Copy link
Collaborator

rhuss commented Feb 11, 2016

@andyshinn adding the possibility to refer to an assembly from within Dockerfile is indeed planned for one of the next versions. I'm just thinking about how this could be done best without breaking the Dockerfile syntax (to much).

@andyshinn
Copy link
Author

OK great. I guess the combination of that + using the alternative Dockerfile method would solve what I want to do. Is there another issue already open for the Dockerfile assembly part? If so, we can just close this.

@rhuss
Copy link
Collaborator

rhuss commented Feb 11, 2016

Its tracked via #205, so I'll close this one for now.

@rhuss rhuss closed this as completed Feb 11, 2016
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

3 participants