Unlink docker init files
This commit is contained in:
parent
7cad77b1e2
commit
29fa1b6666
8
graph.go
8
graph.go
|
@ -11,6 +11,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -212,6 +213,13 @@ func setupInitLayer(initLayer string) error {
|
||||||
// "var/run": "dir",
|
// "var/run": "dir",
|
||||||
// "var/lock": "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 _, err := os.Stat(path.Join(initLayer, pth)); err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
switch typ {
|
switch typ {
|
||||||
|
|
Loading…
Reference in New Issue