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 purge unneeded files #589
Conversation
Sheesh, all this tempfile-optimizations really turns the dockerfile into a nightmare. |
1b91962
to
3ec98da
Compare
Yeah, it's a bit gross. It is cutting down ~12% of the image's size though. What would you like me to do? |
Travis failure is unrelated. |
I'm not sure. At this point, I'm starting to lean toward it being a mistake to have added a Dockerfile to this repo in the first place. |
Also: merge conflict, needs rebase. |
To me, the primary value of the Dockerfile in this repo was to provide a basic, illustrative example of installing the notebook. With all of this size-optimization, this is no longer the case, it seems to be optimizing for use as a base image, and I don't think it's a good candidate for a base image, so this seems misguided. |
e8aa91d
to
96b0c87
Compare
…ppear after `pip` and `npm` steps anyways.
…rectory only contains `bower` stuff and `bower` is removed in this `RUN` step.
…ectory only contains `bower` stuff and `bower` is removed in this `RUN` step.
…and is empty afterwards.
96b0c87
to
2902db6
Compare
The merge conflicts have been resolved. The other issues that you have raised are obviously still outstanding. |
FWIW, I do agree that cleaning is a mess. Normally, this ends up being worse after any sort of testing stage as there really is no interest in keeping such a layer. Instead one is only interested in validating the previously layer works as expected and then continuin/finishing the build without any changes to the final layer caused by testing. This is certainly not the first time I have seen this issue and felt I should raise it after our discussion here with particular regards to testing. I created an issue here ( moby/moby#16993 ) if you are interested. There are some workarounds proposed relating to local builds and builds on Docker Hub. The real solution will likely rely on some sort of nested build implementation. There are many proposals the most notable being this one ( moby/moby#7115 ). In addition to helping with testing, it seems this proposal might make it easier to avoid clean up at almost any However, as it is very versatile it will take some honing before it makes it into In short, given the interest and people behind this change we can be fairly certain we will see something to alleviate this problem, but given the current blockers it won't be soon. |
So, I guess you changed your mind on this one, @minrk. :) |
Not really, I just didn't like the PR sitting there, and din't want to make you rebase, since it would conflict with more recent changes. If we decide this should be a more illustrative example, we will probably remove a lot of the scrubbing in a later PR. |
* Clears the `~/.cache` directory at every build step as `pip` and `npm` are filling it with junk. ( ~100MB ) * Clears the `~/.npm` directory (just used for cache). ( ~36.7MB ) * Clears the `~/.config` directory after building the notebook (only has `bower` stuff and `bower` is removed). * Clears the `~/.local` directory after building the notebook (only has `bower` stuff and `bower` is removed). * Clears the `~/tmp` directory after building the notebook (is already empty).
Well, I still would like to port the useful changes to the Dockerfile collection at some point, but I'm not sure when that will happen. Did anything ever come out of that discussion about how to manage this and the Dockerfiles going forward? |
~/.cache
directory at every build step aspip
andnpm
are filling it with junk. ( ~100MB )~/.npm
directory (just used for cache). ( ~36.7MB )~/.config
directory after building the notebook (only hasbower
stuff andbower
is removed).~/.local
directory after building the notebook (only hasbower
stuff andbower
is removed).~/tmp
directory after building the notebook (is already empty).