mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Container: Inject into the mount, not the rwPath
For device-mapper setups we can't just push the file into the rwPath.
This commit is contained in:
parent
0722786600
commit
c138801073
1 changed files with 8 additions and 3 deletions
11
container.go
11
container.go
|
@ -297,12 +297,17 @@ func (settings *NetworkSettings) PortMappingAPI() []APIPort {
|
||||||
|
|
||||||
// Inject the io.Reader at the given path. Note: do not close the reader
|
// Inject the io.Reader at the given path. Note: do not close the reader
|
||||||
func (container *Container) Inject(file io.Reader, pth string) error {
|
func (container *Container) Inject(file io.Reader, pth string) error {
|
||||||
// Make sure the directory exists
|
if err := container.EnsureMounted(); err != nil {
|
||||||
if err := os.MkdirAll(path.Join(container.rwPath(), path.Dir(pth)), 0755); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the directory exists
|
||||||
|
if err := os.MkdirAll(path.Join(container.RootfsPath(), path.Dir(pth)), 0755); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Handle permissions/already existing dest
|
// FIXME: Handle permissions/already existing dest
|
||||||
dest, err := os.Create(path.Join(container.rwPath(), pth))
|
dest, err := os.Create(path.Join(container.RootfsPath(), pth))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue