mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #23603 from mlaventure/revert-runc-to-mainstream
Vendor in runc cc29e3dded8e27ba8f65738f40d251c885030a28
This commit is contained in:
commit
9cdb6357e2
9 changed files with 33 additions and 17 deletions
|
@ -233,10 +233,10 @@ RUN set -x \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -180,10 +180,10 @@ RUN set -x \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -189,10 +189,10 @@ RUN set -x \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -74,10 +74,10 @@ WORKDIR /go/src/github.com/docker/docker
|
||||||
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
|
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -204,10 +204,10 @@ RUN set -x \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="apparmor seccomp selinux" \
|
&& make static BUILDTAGS="apparmor seccomp selinux" \
|
||||||
|
|
|
@ -197,10 +197,10 @@ RUN set -x \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -57,10 +57,10 @@ ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
|
||||||
ENV CGO_LDFLAGS -L/lib
|
ENV CGO_LDFLAGS -L/lib
|
||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
ENV RUNC_COMMIT 5ce88a95f6cf218ba7f3309562f95464a968e890
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& export GOPATH="$(mktemp -d)" \
|
&& export GOPATH="$(mktemp -d)" \
|
||||||
&& git clone https://github.com/crosbymichael/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
||||||
&& git checkout -q "$RUNC_COMMIT" \
|
&& git checkout -q "$RUNC_COMMIT" \
|
||||||
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
||||||
|
|
|
@ -102,7 +102,7 @@ clone git github.com/miekg/pkcs11 df8ae6ca730422dba20c768ff38ef7d79077a59f
|
||||||
clone git github.com/docker/go v1.5.1-1-1-gbaf439e
|
clone git github.com/docker/go v1.5.1-1-1-gbaf439e
|
||||||
clone git github.com/agl/ed25519 d2b94fd789ea21d12fac1a4443dd3a3f79cda72c
|
clone git github.com/agl/ed25519 d2b94fd789ea21d12fac1a4443dd3a3f79cda72c
|
||||||
|
|
||||||
clone git github.com/opencontainers/runc 85873d917e86676e44ccb80719fcb47a794676a1 # libcontainer
|
clone git github.com/opencontainers/runc cc29e3dded8e27ba8f65738f40d251c885030a28 # libcontainer
|
||||||
clone git github.com/opencontainers/specs v1.0.0-rc1 # specs
|
clone git github.com/opencontainers/specs v1.0.0-rc1 # specs
|
||||||
clone git github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
|
clone git github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0
|
||||||
# libcontainer deps (see src/github.com/opencontainers/runc/Godeps/Godeps.json)
|
# libcontainer deps (see src/github.com/opencontainers/runc/Godeps/Godeps.json)
|
||||||
|
|
|
@ -262,6 +262,8 @@ func readProcsFile(dir string) ([]int, error) {
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ParseCgroupFile parses the given cgroup file, typically from
|
||||||
|
// /proc/<pid>/cgroup, into a map of subgroups to cgroup names.
|
||||||
func ParseCgroupFile(path string) (map[string]string, error) {
|
func ParseCgroupFile(path string) (map[string]string, error) {
|
||||||
f, err := os.Open(path)
|
f, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -269,7 +271,12 @@ func ParseCgroupFile(path string) (map[string]string, error) {
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
s := bufio.NewScanner(f)
|
return parseCgroupFromReader(f)
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function for ParseCgroupFile to make testing easier
|
||||||
|
func parseCgroupFromReader(r io.Reader) (map[string]string, error) {
|
||||||
|
s := bufio.NewScanner(r)
|
||||||
cgroups := make(map[string]string)
|
cgroups := make(map[string]string)
|
||||||
|
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
|
@ -278,7 +285,16 @@ func ParseCgroupFile(path string) (map[string]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
text := s.Text()
|
text := s.Text()
|
||||||
parts := strings.Split(text, ":")
|
// from cgroups(7):
|
||||||
|
// /proc/[pid]/cgroup
|
||||||
|
// ...
|
||||||
|
// For each cgroup hierarchy ... there is one entry
|
||||||
|
// containing three colon-separated fields of the form:
|
||||||
|
// hierarchy-ID:subsystem-list:cgroup-path
|
||||||
|
parts := strings.SplitN(text, ":", 3)
|
||||||
|
if len(parts) < 3 {
|
||||||
|
return nil, fmt.Errorf("invalid cgroup entry: must contain at least two colons: %v", text)
|
||||||
|
}
|
||||||
|
|
||||||
for _, subs := range strings.Split(parts[1], ",") {
|
for _, subs := range strings.Split(parts[1], ",") {
|
||||||
cgroups[subs] = parts[2]
|
cgroups[subs] = parts[2]
|
||||||
|
|
Loading…
Add table
Reference in a new issue