1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #37292 from seemethere/runc

Fix compilation on 32bit machines
This commit is contained in:
Sebastiaan van Stijn 2018-06-15 16:30:08 -07:00 committed by GitHub
commit 59469c63df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 18 deletions

View file

@ -26,7 +26,7 @@ github.com/imdario/mergo v0.3.5
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
# buildkit
github.com/moby/buildkit b062a2d8ddbaa477c25c63d68a9cffbb43f6e474
github.com/moby/buildkit dbf67a691ce77023a0a5ce9b005298631f8bbb4e
github.com/tonistiigi/fsutil 8abad97ee3969cdf5e9c367f46adba2c212b3ddb
github.com/grpc-ecosystem/grpc-opentracing 8e809c8a86450a29b90dcc9efbf062d0fe6d9746
github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3c132e40066a7
@ -75,7 +75,7 @@ github.com/pborman/uuid v1.0
google.golang.org/grpc v1.12.0
# This does not need to match RUNC_COMMIT as it is used for helper packages but should be newer or equal
github.com/opencontainers/runc 0e561642f81e84ebd0b3afd6ec510c75a2ccb71b
github.com/opencontainers/runc ad0f5255060d36872be04de22f8731f38ef2d7b1
github.com/opencontainers/runtime-spec v1.0.1
github.com/opencontainers/image-spec v1.0.1
github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0

View file

@ -1,5 +1,3 @@
### Important: This repository is in an early development phase
[![asciicinema example](https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU.png)](https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU)
@ -29,6 +27,16 @@ Read the proposal from https://github.com/moby/moby/issues/32925
Introductory blog post https://blog.mobyproject.org/introducing-buildkit-17e056cc5317
### Used by
[Moby](https://github.com/moby/moby/pull/37151)
[img](https://github.com/genuinetools/img)
[OpenFaaS Cloud](https://github.com/openfaas/openfaas-cloud)
[container build interface](https://github.com/containerbuilding/cbi)
### Quick start
Dependencies:

View file

@ -83,7 +83,7 @@ func ToRootlessWithContext(ctx RootlessContext, spec *specs.Spec, opts *Rootless
// Add mappings for the current user.
if ctx.InUserNS {
uNextContainerID := 0
uNextContainerID := int64(0)
sort.Sort(idmapSorter(ctx.UIDMap))
for _, uidmap := range ctx.UIDMap {
spec.Linux.UIDMappings = append(spec.Linux.UIDMappings,
@ -94,7 +94,7 @@ func ToRootlessWithContext(ctx RootlessContext, spec *specs.Spec, opts *Rootless
})
uNextContainerID += uidmap.Count
}
gNextContainerID := 0
gNextContainerID := int64(0)
sort.Sort(idmapSorter(ctx.GIDMap))
for _, gidmap := range ctx.GIDMap {
spec.Linux.GIDMappings = append(spec.Linux.GIDMappings,
@ -118,7 +118,7 @@ func ToRootlessWithContext(ctx RootlessContext, spec *specs.Spec, opts *Rootless
Size: 1,
}}
if opts.MapSubUIDGID {
uNextContainerID := 1
uNextContainerID := int64(1)
sort.Sort(subIDSorter(ctx.SubUIDs))
for _, subuid := range ctx.SubUIDs {
spec.Linux.UIDMappings = append(spec.Linux.UIDMappings,
@ -129,7 +129,7 @@ func ToRootlessWithContext(ctx RootlessContext, spec *specs.Spec, opts *Rootless
})
uNextContainerID += subuid.Count
}
gNextContainerID := 1
gNextContainerID := int64(1)
sort.Sort(subIDSorter(ctx.SubGIDs))
for _, subgid := range ctx.SubGIDs {
spec.Linux.GIDMappings = append(spec.Linux.GIDMappings,

View file

@ -18,7 +18,7 @@ github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
github.com/golang/protobuf v1.1.0
github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc 0e561642f81e84ebd0b3afd6ec510c75a2ccb71b
github.com/opencontainers/runc ad0f5255060d36872be04de22f8731f38ef2d7b1
github.com/Microsoft/go-winio v0.4.7
github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
github.com/opencontainers/runtime-spec v1.0.1
@ -63,5 +63,5 @@ github.com/opentracing-contrib/go-stdlib b1a47cfbdd7543e70e9ef3e73d0802ad306cc1c
github.com/opencontainers/selinux 74a747aeaf2d66097b6908f572794f49f07dda2c
# used by dockerfile tests
github.com/gotestyourself/gotestyourself cf3a5ab914a2efa8bc838d09f5918c1d44d029
gotest.tools v2.1.0
github.com/google/go-cmp v0.2.0

View file

@ -123,8 +123,8 @@ func UIDMapInUserNS(uidmap []user.IDMap) bool {
}
// GetParentNSeuid returns the euid within the parent user namespace
func GetParentNSeuid() int {
euid := os.Geteuid()
func GetParentNSeuid() int64 {
euid := int64(os.Geteuid())
uidmap, err := user.CurrentProcessUIDMap()
if err != nil {
// This kernel-provided file only exists if user namespaces are supported

View file

@ -78,15 +78,15 @@ func groupFromOS(g *user.Group) (Group, error) {
// SubID represents an entry in /etc/sub{u,g}id
type SubID struct {
Name string
SubID int
Count int
SubID int64
Count int64
}
// IDMap represents an entry in /proc/PID/{u,g}id_map
type IDMap struct {
ID int
ParentID int
Count int
ID int64
ParentID int64
Count int64
}
func parseLine(line string, v ...interface{}) {
@ -113,6 +113,8 @@ func parseParts(parts []string, v ...interface{}) {
case *int:
// "numbers", with conversion errors ignored because of some misbehaving configuration files.
*e, _ = strconv.Atoi(p)
case *int64:
*e, _ = strconv.ParseInt(p, 10, 64)
case *[]string:
// Comma-separated lists.
if p != "" {
@ -122,7 +124,7 @@ func parseParts(parts []string, v ...interface{}) {
}
default:
// Someone goof'd when writing code using this function. Scream so they can hear us.
panic(fmt.Sprintf("parseLine only accepts {*string, *int, *[]string} as arguments! %#v is not a pointer!", e))
panic(fmt.Sprintf("parseLine only accepts {*string, *int, *int64, *[]string} as arguments! %#v is not a pointer!", e))
}
}
}