Skip to content

Commit

Permalink
Merge pull request #141 from outofcoffee/feature/chaining-filesystem-…
Browse files Browse the repository at this point in the history
…bind

Allows chaining when adding file system binds.
  • Loading branch information
rnorth committed Apr 28, 2016
2 parents 5805be6 + 5845160 commit 9962f8c
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,30 @@ public void addEnv(String key, String value) {
env.add(key + "=" + value);
}

/**
* Adds a file system binding.
*
* @param hostPath the file system path on the host
* @param containerPath the file system path inside the container
* @param mode the bind mode
*/
public void addFileSystemBind(String hostPath, String containerPath, BindMode mode) {

binds.add(new Bind(hostPath, new Volume(containerPath), mode.accessMode));
}

/**
* Adds a file system binding.
*
* @param hostPath the file system path on the host
* @param containerPath the file system path inside the container
* @param mode the bind mode
* @return this
*/
public GenericContainer withFileSystemBind(String hostPath, String containerPath, BindMode mode) {
addFileSystemBind(hostPath, containerPath, mode);
return this;
}

public void addLink(LinkableContainer otherContainer, String alias) {
this.linkedContainers.put(alias, otherContainer);
}
Expand Down

0 comments on commit 9962f8c

Please sign in to comment.