Last active
September 1, 2015 05:13
-
-
Save robmazan/4b96802f9212d703e85c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function docker-compose() { | |
if ($pwd.Path.StartsWith('C:\Users')) { | |
$projectName = Split-Path "$pwd" -leaf | |
$dockerPath = "/c" + $($($pwd -replace "^[a-z]:(.*)$",'$1') -replace "\\","/") | |
$dockerCmd = "docker run -v $dockerPath" + ":/$dockerPath -w $dockerPath -v /var/run/docker.sock:/var/run/docker.sock -e COMPOSE_PROJECT_NAME=$projectName -ti --rm dduportal/docker-compose:latest $args" | |
Write-Host $dockerCmd | |
Invoke-Expression $dockerCmd | |
} else { | |
Write-Error 'You must be under C:\Users, otherwise fileshare to boot2docker will not work!' | |
} | |
} |
Hello @robmazan, i read your comment on the Dockerhub (https://hub.docker.com/r/dduportal/docker-compose/), thanks for sharing !
Is it possible to do a pull request on the source repository of my image (https://github.com/dduportal-dockerfiles/docker-compose) where you add your code snippet AND your name as maintainer in the Dockerfile ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can copy-paste the function definition to your PS command line, and start using your new
docker-compose
command! :)