Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jason committed Jun 14, 2019
1 parent c20c175 commit 3190888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2019051013
2019061409
21 changes: 1 addition & 20 deletions container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ func DockerCommit(id, newname, newtag string) *Error {
RemoveAll(cache)
}
}
//moving /etc/group /etc/passwd /proc /tmp folder to temp folder
//moving /etc/group /etc/passwd /tmp folder to temp folder
cache_temp_dir, _ := ioutil.TempDir("", "lpmx")
if FileExist(fmt.Sprintf("%s/etc/group", con.RootPath)) {
cerr := Rename(fmt.Sprintf("%s/etc/group", con.RootPath), fmt.Sprintf("%s/etc/group", cache_temp_dir))
Expand All @@ -923,12 +923,6 @@ func DockerCommit(id, newname, newtag string) *Error {
return cerr
}
}
if FolderExist(fmt.Sprintf("%s/proc", con.RootPath)) {
cerr := Rename(fmt.Sprintf("%s/proc", con.RootPath), fmt.Sprintf("%s/proc", cache_temp_dir))
if cerr != nil {
return cerr
}
}
if FolderExist(fmt.Sprintf("%s/tmp", con.RootPath)) {
RemoveAll(fmt.Sprintf("%s/tmp", con.RootPath))
}
Expand Down Expand Up @@ -1051,11 +1045,6 @@ func DockerCommit(id, newname, newtag string) *Error {
return cerr
}
}
//create rw/proc/self/cwd to fake cwd
proc_self_path := fmt.Sprintf("%s/proc/self", con.RootPath)
os.MkdirAll(proc_self_path, os.FileMode(FOLDER_MODE))
os.Symlink("/", fmt.Sprintf("%s/cwd", proc_self_path))
os.Symlink("/", fmt.Sprintf("%s/exe", proc_self_path))
//create new tmp
os.MkdirAll(fmt.Sprintf("%s/tmp", con.RootPath), os.FileMode(FOLDER_MODE))
f, _ := os.Create(fmt.Sprintf("%s/.wh.tmp", con.RootPath))
Expand Down Expand Up @@ -1618,12 +1607,6 @@ func DockerCreate(name string, container_name string) *Error {
}
}

//create rw/proc/self/cwd to fake cwd
proc_self_path := fmt.Sprintf("%s/proc/self", configmap["dir"].(string))
os.MkdirAll(proc_self_path, os.FileMode(FOLDER_MODE))
os.Symlink("/", fmt.Sprintf("%s/cwd", proc_self_path))
os.Symlink("/", fmt.Sprintf("%s/exe", proc_self_path))

//create tmp folder and create whiteout file for tmp
os.MkdirAll(fmt.Sprintf("%s/tmp", configmap["dir"].(string)), os.FileMode(FOLDER_MODE))
f, _ := os.Create(fmt.Sprintf("%s/.wh.tmp", configmap["dir"].(string)))
Expand Down Expand Up @@ -1863,8 +1846,6 @@ func (con *Container) genEnv() (map[string]string, *Error) {
env["PWD"] = "/"
env["HOME"] = "/root"
env["FAKED_MODE"] = "unknown-is-root"
//used for faking proc file
env["FAKECHROOT_EXCLUDE_PROC_PATH"] = "/proc/self/cwd:/proc/self/exe"
if con.DockerBase {
env["DockerBase"] = "TRUE"
} else {
Expand Down

0 comments on commit 3190888

Please sign in to comment.