Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
do not add duplicate binds to docker container definition
Browse files Browse the repository at this point in the history
  • Loading branch information
joejulian committed Jan 4, 2017
1 parent 1e2b305 commit 7ae1588
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/container_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func parseMounts(deployment reflect.Value, hostConfig *container.HostConfig, con

if _, err := os.Stat(os.ExpandEnv(reflectedString)); err == nil {
if filepath.IsAbs(os.ExpandEnv(reflectedString)) {
for _, bind := range hostConfig.Binds {
if bind == os.ExpandEnv(reflectedString)+":"+os.ExpandEnv(reflectedString) {
return
}
}
hostConfig.Binds = append(hostConfig.Binds, os.ExpandEnv(reflectedString)+":"+os.ExpandEnv(reflectedString))
}
}
Expand Down

0 comments on commit 7ae1588

Please sign in to comment.