Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Use image for bucket name with docker, if box is unset #116

Merged

Conversation

jbarbuto
Copy link
Contributor

This allows multiple machines using the image to share the cache
and avoids the following error:

/Applications/Vagrant/embedded/lib/ruby/2.0.0/pathname.rb:389:in
`initialize': no implicit conversion of nil into String (TypeError)

This allows multiple machines using the image to share the cache
and avoids the following error:

    /Applications/Vagrant/embedded/lib/ruby/2.0.0/pathname.rb:389:in
    `initialize': no implicit conversion of nil into String (TypeError)
@fgrehm
Copy link
Owner

fgrehm commented Jul 23, 2014

Sounds reasonable to me, but from the error you pointed out it seems that you are using the docker provider from a MacOS machine with the docker host / boot2docker and, if I'm not mistaken, by default you won't get the packages synced back to your host because it uses rsync synced folders. Are you doing something different than that?

I still think that's valuable for linux users running docker natively and will look into merging it as soon as I have a chance. Thanks a lot 🍻

@jbarbuto
Copy link
Contributor Author

Sorry, should have mentioned I'm using a box from https://github.com/phusion/open-vagrant-boxes as the host VM, which defaults to VirtualBox synced folders. Perhaps we could detect if boot2docker is being used and warn accordingly, or whether an rsync synced folder is being used in general?

@fgrehm
Copy link
Owner

fgrehm commented Jul 24, 2014

Perhaps we could detect if boot2docker is being used and warn accordingly, or whether an rsync synced folder is being used in general?

Yeah, but I'd rather just error out instead of warn as it is likely to be an undesired behavior (unless there is some two way rsync in place that I'm not aware of). I'm just not sure how to detect that right now because we can't rely on Vagrantfile configs as each provider has its defaults.

As for this PR, I haven't been able to give this a try but I'll look into doing that and merging it as soon as possible. If you can't do the rsync detection don't worry, it's "out of scope" for this PR anyways 😸

If build_dir is set instead for building images on demand, there's no way to
know what to set the bucket name to, except perhaps parsing it from Dockerfile.
@jbarbuto
Copy link
Contributor Author

Agreed that erroring out is preferable to a warning with rsync synced folders. Another case where it seems appropriate is when the docker provider is being used with build_dir for building images on demand. I've added another commit to ensure that image is set.

@fgrehm fgrehm added this to the v1.0 milestone Jul 29, 2014
@fgrehm fgrehm merged commit b7b3bcb into fgrehm:master Aug 9, 2014
@fgrehm
Copy link
Owner

fgrehm commented Aug 9, 2014

Many thanks! This is likely to be the last feature that will get into 1.0 🍻

@jbarbuto jbarbuto deleted the use_image_for_bucket_name_with_docker branch August 9, 2014 19:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants