dotnet / dotnet/Docker.DotNet

Example how to run command in running container

Open
#367 17 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
416
PR merge metrics
No merged PRs in 30d

Description

has anyone been able to run a mkdir in a running container successfully using the dotnet api?

I cant seem to see the directory being created in the container. this is the code i have tried: -

var created = await Docker.Containers.ExecCreateContainerAsync("3375e8971d875972dd0d5bb324c43270335a5266fa51946731b1d52192709f23", new ContainerExecCreateParameters()
{
AttachStdin = true,
AttachStdout = true,
Cmd = new List()
{
"mkdir",
"test"
},
Tty = true,
AttachStderr = true,

});

await Docker.Containers.StartContainerExecAsync(created.ID);

end result no folder in the container.

any ideas would be great.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.