Skip to content

Instantly share code, notes, and snippets.

@robmazan
Last active September 1, 2015 05:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmazan/4b96802f9212d703e85c to your computer and use it in GitHub Desktop.
Save robmazan/4b96802f9212d703e85c to your computer and use it in GitHub Desktop.
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!'
}
}
@robmazan
Copy link
Author

robmazan commented Aug 4, 2015

You can copy-paste the function definition to your PS command line, and start using your new docker-compose command! :)

@dduportal
Copy link

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