mirror of https://github.com/docker/docs.git
- Fix a few bugs in external mount-bind integration
This commit is contained in:
parent
d4e62101ab
commit
67239957c9
|
@ -145,11 +145,10 @@ func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
// add any bind targets to the list of container volumes
|
// add any bind targets to the list of container volumes
|
||||||
type empty struct{}
|
|
||||||
for _, bind := range flBinds {
|
for _, bind := range flBinds {
|
||||||
arr := strings.Split(bind, ":")
|
arr := strings.Split(bind, ":")
|
||||||
dstDir := arr[1]
|
dstDir := arr[1]
|
||||||
flVolumes[dstDir] = empty{}
|
flVolumes[dstDir] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
parsedArgs := cmd.Args()
|
parsedArgs := cmd.Args()
|
||||||
|
@ -564,7 +563,6 @@ func (container *Container) Start(hostConfig *HostConfig) error {
|
||||||
container.Volumes[volPath] = id
|
container.Volumes[volPath] = id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
container.VolumesRW = make(map[string]bool)
|
|
||||||
|
|
||||||
if err := container.generateLXCConfig(); err != nil {
|
if err := container.generateLXCConfig(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -84,9 +84,9 @@ lxc.mount.entry = {{.SysInitPath}} {{$ROOTFS}}/sbin/init none bind,ro 0 0
|
||||||
# In order to get a working DNS environment, mount bind (ro) the host's /etc/resolv.conf into the container
|
# In order to get a working DNS environment, mount bind (ro) the host's /etc/resolv.conf into the container
|
||||||
lxc.mount.entry = {{.ResolvConfPath}} {{$ROOTFS}}/etc/resolv.conf none bind,ro 0 0
|
lxc.mount.entry = {{.ResolvConfPath}} {{$ROOTFS}}/etc/resolv.conf none bind,ro 0 0
|
||||||
{{if .Volumes}}
|
{{if .Volumes}}
|
||||||
+{{ $rw := .VolumesRW }}
|
{{ $rw := .VolumesRW }}
|
||||||
+{{range $virtualPath, $realPath := .Volumes}}
|
{{range $virtualPath, $realPath := .Volumes}}
|
||||||
+lxc.mount.entry = {{$realPath}} {{$ROOTFS}}/{{$virtualPath}} none bind,{{ if index $rw $virtualPath }}rw{{else}}ro{{end}} 0 0
|
lxc.mount.entry = {{$realPath}} {{$ROOTFS}}/{{$virtualPath}} none bind,{{ if index $rw $virtualPath }}rw{{else}}ro{{end}} 0 0
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue