| ... | ... |
@@ -110,7 +110,7 @@ func (builder *Builder) Build(dockerfile io.Reader, stdout io.Writer) error {
|
| 110 | 110 |
} |
| 111 | 111 |
|
| 112 | 112 |
// Commit the container |
| 113 |
- base, err := builder.Commit(c, "", "", "", "") |
|
| 113 |
+ base, err = builder.Commit(c, "", "", "", "") |
|
| 114 | 114 |
if err != nil {
|
| 115 | 115 |
return err |
| 116 | 116 |
} |
| ... | ... |
@@ -170,7 +170,12 @@ func (settings *NetworkSettings) PortMappingHuman() string {
|
| 170 | 170 |
|
| 171 | 171 |
// Inject the io.Reader at the given path. Note: do not close the reader |
| 172 | 172 |
func (container *Container) Inject(file io.Reader, pth string) error {
|
| 173 |
- dest, err := os.Open(path.Join(container.rwPath(), pth)) |
|
| 173 |
+ // Make sure the directory exists |
|
| 174 |
+ if err := os.MkdirAll(path.Join(container.rwPath(), path.Dir(pth)), 0755); err != nil {
|
|
| 175 |
+ return err |
|
| 176 |
+ } |
|
| 177 |
+ // FIXME: Handle permissions/already existing dest |
|
| 178 |
+ dest, err := os.Create(path.Join(container.rwPath(), pth)) |
|
| 174 | 179 |
if err != nil {
|
| 175 | 180 |
return err |
| 176 | 181 |
} |