How to pass z flag for volume mount using docker golang library ? For supporting Selinux
1条回答 默认 最新
- dongmi1941 2019-01-14 22:20关注
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, "", )
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报