How to pass z flag for volume mount using docker golang library ? For supporting Selinux
Asked
Active
Viewed 463 times
0
-
Could you provide a bit more detail about you question? Sample code? – daplho Jan 14 '19 at 21:01
1 Answers
0
I would think you can just add ':z' to the path of the volume, which is a string:
res, err := client.ContainerCreate(
ctx,
&container.Config{
Image: "nginx",
Cmd: []string{},
},
&container.HostConfig{
Mounts: []mount.Mount{
{
Type: mount.TypeVolume,
Source: "/app:z", // <---- HERE
Target: "/target",
},
},
},
nil,
"",
)

blobdon
- 1,176
- 7
- 11
-
This definitely *does not* work. Instead, it causes a folder named `/app:z` to be created on the host and mounted. – Herohtar Feb 11 '22 at 21:12