Skip to content

Commit

Permalink
Introduce an abstraction over files and classpath resources.
Browse files Browse the repository at this point in the history
This encapsulates all the complexity of generating a path that the Docker daemon is about to create a volume mount for.

This should resolve a general problem with spaces in paths, which was seen in one particular form as #263.

Additional tests for the specific problem in #263 will be added shortly.
  • Loading branch information
rnorth committed Apr 10, 2017
1 parent 4a4ff3d commit 5a39311
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public void addEnv(String key, String value) {
public void addFileSystemBind(String hostPath, String containerPath, BindMode mode) {

final MountableFile mountableFile = MountableFile.forHostPath(hostPath);
binds.add(new Bind(mountableFile.getResolvedPath(), new Volume(containerPath), mode.accessMode));
binds.add(new Bind(mountableFile.getMountablePath(), new Volume(containerPath), mode.accessMode));
}

/**
Expand Down Expand Up @@ -618,7 +618,7 @@ public SELF withNetworkMode(String networkMode) {
public SELF withClasspathResourceMapping(String resourcePath, String containerPath, BindMode mode) {
final MountableFile mountableFile = MountableFile.forClasspathResource(resourcePath);

this.addFileSystemBind(mountableFile.getResolvedPath(), containerPath, mode);
this.addFileSystemBind(mountableFile.getMountablePath(), containerPath, mode);

return self();
}
Expand Down

0 comments on commit 5a39311

Please sign in to comment.