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

(MAINT) fix paths when using DOCKER_TOOLBOX on windows #7

Merged
merged 1 commit into from
Apr 9, 2018

Conversation

tabakhase
Copy link
Contributor

Turns D:/devstuff into /d/devstuff when detecting DOCKER_TOOLBOX (docker inside virtualbox on windows)
fixes Docker::Error::ServerError: invalid volume specification: 'D:/devstuff:/tmp/stuff'


I assume thats by far not the elegant way todo that (rubynoob), so feel free to edit.

a = [ File.expand_path(mount['host_path']), mount['container_path'] ]
host_path = File.expand_path(mount['host_path'])
# When using docker_toolbox and getting a "(Driveletter):/" path, convert windows path to VM mount
if ENV['DOCKER_TOOLBOX_INSTALL_PATH'] && host_path =~ /^.\:\//
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't used Docker Toolbox, is DOCKER_TOOLBOX_INSTALL_PATH a standard environment variable set up by the installer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeps, installer sets that https://github.com/docker/toolbox/blob/c971a9cb9b35f5bea1d3724702423135b530a226/windows/Toolbox.iss#L91

Its also used when running the "docker shell" executable - so should stay arround https://github.com/docker/toolbox/blob/master/windows/start.sh


With the path check /^.\:\// I belive its fairly safe to use for anyone...
-> mac has docker_toolbox too

Only acts on C:/ not C:\ so when using msys/gitbash
-> should not affect cmd/powershell (windows-on-windows-dev?)

Having "native and toolbox" installed breaks a bunch of other things,
->so likely "should not be our problem"

Copy link

@Sharpie Sharpie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, only activates when Docker Toolbox is installed.

@Sharpie Sharpie requested a review from kevpl April 2, 2018 15:01
@kevpl
Copy link
Contributor

kevpl commented Apr 5, 2018

@tabakhase one quick contributor standard item before moving forward: please prepend your git commit message with (MAINT), so that we can see this is a small fix not related to a ticket. This seems small enough that with that, we don't need a new test added for this.

Once that's done, we'll re-kick testing to push it through the automation and towards merging. Thanks for the fix!

@tabakhase tabakhase changed the title fix paths when using DOCKER_TOOLBOX on windows (MAINT) fix paths when using DOCKER_TOOLBOX on windows Apr 5, 2018
Turns `D:/devstuff` into `/d/devstuff` when detecting DOCKER_TOOLBOX (docker inside virtualbox on windows)
fixes `Docker::Error::ServerError: invalid volume specification: 'D:/devstuff:/tmp/stuff'`
@tabakhase
Copy link
Contributor Author

@kevpl PR & commit have been updated.
thanks in advance =)

@mchllweeks
Copy link
Contributor

Jenkins, test this please

@smcelmurry
Copy link
Contributor

test this please

@puppetlabs-jenkins
Copy link
Contributor

Can one of the admins verify this patch?

@mchllweeks mchllweeks merged commit 7dee770 into voxpupuli:master Apr 9, 2018
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

Successfully merging this pull request may close these issues.

None yet

6 participants