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

shared folders between host and container #101

Open
Gmapoub opened this issue Sep 23, 2017 · 1 comment
Open

shared folders between host and container #101

Gmapoub opened this issue Sep 23, 2017 · 1 comment

Comments

@Gmapoub
Copy link

Gmapoub commented Sep 23, 2017

Can you create a container with shared folders between host and container?
Thank you

@m0schaefer
Copy link

Worked for me on Docker Toolbox and Docker for Windows:
...
List binds = new ArrayList<>();
binds.add("//c/Users:/logs");
Map<String, Object> volumes = new HashMap<>();
volumes.put("/logs", null);

HostConfig hostConfig = new HostConfig();
hostConfig.setBinds(binds);

ContainerCreateResponse container = client.container().createNew()
.withImage(imageName)
.withName(containerName)
.withEnv(envVariable)
.withHostConfig(hostConfig)
.withVolumes(volumes)

.withAttachStderr(true)
.withAttachStdout(true)
.done();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants