MCPcopy
hub / github.com/docker/compose / toBindString

Function toBindString

pkg/compose/create.go:922–938  ·  view source on GitHub ↗
(name string, v *types.ServiceVolumeConfig)

Source from the content-addressed store, hash-verified

920}
921
922func toBindString(name string, v *types.ServiceVolumeConfig) string {
923 access := "rw"
924 if v.ReadOnly {
925 access = "ro"
926 }
927 options := []string{access}
928 if v.Bind != nil && v.Bind.SELinux != "" {
929 options = append(options, v.Bind.SELinux)
930 }
931 if v.Bind != nil && v.Bind.Propagation != "" {
932 options = append(options, v.Bind.Propagation)
933 }
934 if v.Volume != nil && v.Volume.NoCopy {
935 options = append(options, "nocopy")
936 }
937 return fmt.Sprintf("%s:%s:%s", name, v.Target, strings.Join(options, ","))
938}
939
940func findVolumeByName(volumes types.Volumes, name string) *types.VolumeConfig {
941 for _, vol := range volumes {

Callers 1

buildContainerVolumesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected