-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
host-mounted volumes in Dockerfile's VOLUME #3156
Comments
this might be an interesting candidate for an example of a volume-container
but i agree, its a shame that |
+1 - I'm not sure what the best compromise is, but have run into this quandary myself for sure When I first created tianon/gentoo, I realized I didn't want to encourage people to be doing This is exactly why I haven't updated tianon/gentoo in a while, and haven't given any more serious thought to creating a standard "gentoo" base image out of the stage3s, because I couldn't come up with a reasonable compromise that wouldn't be "just for Gentoo" and have other people doing bad things with, like the old EXPOSE syntax allowed. |
On Wed, Dec 11, 2013 at 07:08:51AM -0800, Tianon Gravi wrote:
Do we need to compromise? Extending the
Gentoo makes it easy to setup a local Portage mirror, from which you For what it's worth, my build script is here: |
Builds must be host-independent. If you want to use a particular portage tree as part of the build, simply add it to your container. You could use a Gentoo base image, and extend it as needed. Whatever gain you think you'll get from mount-binding whatever is on the host for a build, it will pale in comparison to destroying the entire premise of why containers are useful. |
On Wed, Dec 11, 2013 at 10:19:21AM -0800, Solomon Hykes wrote:
What I'm suggesting is as host independent as downloading packages
I'm not sure who you're protecting by avoiding host-mounted volumes |
Yes, see the "Trusted Builds" feature on index.docker.io. :) |
On Wed, Dec 11, 2013 at 01:19:32PM -0800, Tianon Gravi wrote:
Ah, the lack of host-mounted volumes makes more sense in this context
To volume-mount from an existing trusted build. That way the I don't know how the trusted build processing works, maybe from |
I really like the idea of pulling the portage data from a separate image, and definitely agree that something is necessary for Gentoo as an image base to be even remotely possible. It's not only bad etiquette to It also takes long enough that I think it's unreasonable to do in each Dockerfile, because unlike "apt-get update", it effectively has to download a build/installation script for every package available in the tree (that's the nature of the beast). |
On Wed, Dec 11, 2013 at 01:43:18PM -0800, W. Trevor King wrote:
This may not actually work with Trusted Builds, where tags look like a I don't think that's a deal-breaker for the Portage-mirror use case |
On Wed, Dec 11, 2013 at 01:43:18PM -0800, W. Trevor King wrote:
I've added ${NAMESPACE}/portage image creation to my Dockerfile repo I think usage should mirror FROM:
This would add the volume image names to the built-image's metadata
invocations would look up VOLUMES-FROM images in the metadata and spin There's no UNSET-ENV equivalent to pattern on, but I think we would An obvious extension of this would be, “I want to spin up a server and ADD-SERVER {-volumes-from|-link } [:] but I'd be happy with just VOLUMES-FROM ;). Thoughts? |
👍 I would like to use Gentoo as a base image but definitely don't want > 1GB of Portage tree data to be in any of the layers once the image has been built. You could have some nice a compact containers if it wasn't for the gigantic portage tree having to appear in the image during the install. |
Here's another suggestion. You'd incur some bandwidth overhead having to
|
On Thu, Mar 06, 2014 at 04:51:42PM -0800, d11wtq wrote:
That's a good idea. With a package-cache container [1,2] that |
I want something like a -v option for builds because I would like to bind mount the puppet client, and manifests during build time. The end result would be a pristine container image that would be configured with Puppet (et. al.) but would contain none of the bloat? I get why you guys don't want to put it in the Dockerfile, but why limit it from the build command? These are two different things. People share Docker files, but I am not sure they need to share ALL build hosts? I see the build command as something that IS specific to the build host, which is fine... I am sure I can imagine other use cases where a pristine docker image would be really nice... Best Regards |
+1. |
+1 |
+1 @fatherlinux suggestion. Much needed here installing up from large .tar.zg exploded tarballs... |
@fatherlinux @zrml Can you open an issue with your use-case rather than a possible solution? |
+1. |
I will as soon as I get a chance... ----- Original Message -----
|
Done, created issue: #14251 |
As a thought on this... for a short term work around, maybe this?
then volume over /usr/portage in docker create. It does have the downside of having an image hanging around for any images based off it though. Definitely need the -v though for ephemeral stuff that shouldn't be in the images. Beyond the case of large filesets, adding and then removing something creates a file system layer so not only does bloats the image but also incurs the same problems as committing secrets to a VCS. I can appreciate that these kind of environment specific but always required files do run against the idea of universal Dockerfiles, but ADD already does that. |
I have a following use case: I need to have a working ssh to run commands from Dockerfile during a build of image. The ssh server I'm connecting to uses ssh public key authorization. Just sharing my pain. |
+1 |
In #1124, there was an explicit decision to not allow host-mounted volumes via the
VOLUME
command. However, I think I have a good use case for supporting host-mounts viaVOLUME
. Gentoo stores it's package repository under/usr/portage
. I'm trying to set up a workflow like:However,
VOLUME
doesn't support that, anddocker build …
doesn't support the-v
tag. The end goal is to get a production image that doesn't include/usr/portage
, since the package repository just bloats the production container. I can think of a few workarounds including NFS-mounting/usr/portage
during the build or using:for each of the build steps, but native
Dockerfile
support would be nice.The text was updated successfully, but these errors were encountered: