mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Unlink docker init files
This commit is contained in:
parent
7cad77b1e2
commit
29fa1b6666
1 changed files with 8 additions and 0 deletions
8
graph.go
8
graph.go
|
@ -11,6 +11,7 @@ import (
|
|||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -212,6 +213,13 @@ func setupInitLayer(initLayer string) error {
|
|||
// "var/run": "dir",
|
||||
// "var/lock": "dir",
|
||||
} {
|
||||
parts := strings.Split(pth, "/")
|
||||
prev := "/"
|
||||
for _, p := range parts[1:] {
|
||||
prev = path.Join(prev, p)
|
||||
syscall.Unlink(path.Join(initLayer, prev))
|
||||
}
|
||||
|
||||
if _, err := os.Stat(path.Join(initLayer, pth)); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
switch typ {
|
||||
|
|
Loading…
Add table
Reference in a new issue