-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
dockerfile: Split the ADD command #3050
Comments
👍 👍 👍 👍 👍 I agree with you Here are my comments:
|
Massive +1s, and I love @vieux's suggestion of just As a side note, the hash verification stuff was already covered in #2579, and I think that'd be the appropriate place to discuss that further, especially since splitting ADD alone is a big enough topic for one issue. :) I think the "remote download" items could also do with Last-Modified and/or ETag HEAD lookups for when we eventually get "ADD caching", but that's not really the discussion here either. 👍 |
I can work with COPY and UNTAR. |
explicit > implicit +1 |
why ie, first up, |
One difference is that "run tar" depends on the version of tar available in the image. It's better to guarantee the same version everywhere (ideally docker would embed its own implementation) , and insome scenarios the images will not have tar at all. On Tue, Dec 10, 2013 at 11:05 PM, Sven Dowideit notifications@github.com
|
understood |
Also because that would double the size of our base images, not to mention where does the original tar come from when we start with nothing? I think it's very important that we keep the ability to create a layer entirely from a tar (for our base images at least), I would just be extremely grateful for a way to do so with a remote tar too, and if we could disentangle ADD while we're at it, I see that as a win, personally. |
Another vote for disentangling it. I've just run into a problem, and even my hacky workaround wasn't enough to get around the ADD magic. I've got a tarball in my context (local) that needs to get copied into the image compressed (it gets used later on directly, not decompressed). I started out trying to ADD it, but discovered that it got untarred. As a workaround, I renamed it to .foo instead of .tar.gz and it still got decompressed! Not sure what my next attempt is going to be, but it'd be awesome if there were a straightforward way to just say "copy this file as-is". Edit: A final workaround that actually worked: Before hand: In Dockerfile: |
I think
I imagine Maybe this warrants an issue, not a comment, but it seems very relevant here. |
We have a bunch of bugs on ADD at the moment. What's the best way to pitch a strawman implementation? |
+1 this magical ADD also has surprising results when you WANT an archive in the image. For instance, when adding a locally built gem I need to tar it first so the expansion doesn't break my |
+1 for no magical untar. - this is not intuitional IMO. This has caused hours of headache and troubleshooting.
fails with confusing errors that are hard to troubleshoot because /tmp/database_to_import.tar becomes a directory inside the container without warning (except for one sentence deep in the ADD documentation.) For now the only way I can find to get a tar file into an image without it auto-untarring is to make an extra directory and put the tar file in there like this:
But that quickly becomes cumbersome. |
There's a new Splitting up the |
So, now that we have |
@EdBoraas We thought about that, and although we definitely would like to have |
👍 I require the ability to use an archive as the rootfs for my image stored remotely. Currently there is no way to do this with a Dockerfile. ADD will only extract local images which limits my options. Whether ADD should support extracting remote archives (which introduces a BC break) or a new command is added to extract remote archives (which preserves BC and could be named more intuitively) is of little concern to me since at this moment in time the feature to extract remote archives into the file system is completely missing but I would make good use of it if it were available. However, I'd like to cast a vote in favour of |
Need the following:
|
Once we have #10775 merged we can look to add options to ADD to allow for finer control over what happens. I would prefer to do that than to add a ton of new top level Dockerfile commands that almost do the same thing as each other. We can even then look to merge COPY and ADD, even having just those two causes confusion. |
👍 |
We also need a reliable caching of Where #7748 is as another possible solution to our caching problem. It downloads them every time, which sucks. |
Hello! Mainly:
Then from there, patches/features like this can be re-thought. Hope you can understand. |
I spent a good 4 hours trying to understand why the images would build correctly locally but when built in jenkins/kaniko they would miss the `dist` folders. Turns out ADD is too magical, and in some occasions it would not untar. See: moby/moby#3050
Currently the ADD command is IMO far too magical. It can add local and remote files. It will sometimes untar a file and it will sometimes not untar a file. If a file is a tarball that you want to copy, you accidentally untar it. If the file is a tarball in some unrecognized compressed format that you want to untar, you accidentally copy it.
There's also essentially no security for downloads.
Can we have unambiguous options, please. For example:
etc.
The text was updated successfully, but these errors were encountered: