Commit Graph

35 Commits

Author SHA1 Message Date
Iceber Gu
d08aa4b681
oci: fix the file mode of the device
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-02-10 16:37:12 +08:00
Michael Crosby
02afa94256 Add --cpus flag to ctr
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-07-28 23:06:07 -04:00
Michael Crosby
a6d3f4d30b
Add device opts to ctr --privileged
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-10 14:23:59 -04:00
Michael Crosby
725d3ad8cb Add --device flag to ctr
Closes #3066

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-18 18:51:05 +00:00
Justin Terry (VM)
c818a6b13d Merges the oci package for Linux and Windows
On Windows we need to be able to create both Linux and Windows OCI spec
files by default to support WCOW and LCOW scenarios. This merges the
compile time differences into runtime differences between the two based
on the spec and platform the user sets.

It maintains the old behavior with Default specs resulting in the
platform default the binary is compiled for.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-08-30 09:46:04 -07:00
Michael Crosby
4b9b3e8fc9 Add WithAmbientCapabilities opt
Closes #2516

This can be used for non-root users binding to low ports.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-27 17:16:44 -04:00
kadisi
7dae56671d set args value of process if args is nil
Signed-off-by: kadisi <iamkadisi@163.com>
2018-08-21 09:44:50 +08:00
Michael Crosby
b67ea850af Add opt for default unix device permissions
These opts either inherit the parent cgroup device.list or append the
default unix devices like /dev/null /dev/random so that the container
has access.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-15 11:52:43 -04:00
Ian Campbell
4a74731cd0 oci: Update docs for oci.WithUserID
The behaviour was changed in 99df1a9e11 ("Set gid 0 when no group is
specified"), part of #2529.

Take the opportunity to tighten up the grammar a bit too.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2018-08-08 15:32:59 +01:00
Michael Crosby
99df1a9e11 Set gid 0 when no group is specified
This change is to match Docker's implementaion of setting gid and groups
to 0 when no gid is specified but an explicit uid is set.

Fixes #2527

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-06 15:08:59 -04:00
Michael Crosby
e956441fe0 Add WithImageConfigArgs to replace CMD on image
This allows users to provide args for the process arguments while
creating the base spec with an image.  It provides the same symantics as
Docker where additional args replace the CMD while leaving the
ENTRYPOINT the same.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-27 12:09:11 -04:00
Akihiro Suda
d88de4a34f content: change Writer/ReaderAt to take OCI
This change allows implementations to resolve the location of the actual data
using OCI descriptor fields such as MediaType.

No OCI descriptor field is written to the store.

No change on gRPC API.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-06-01 11:51:43 +09:00
Michael Crosby
62e22a9fe7 Type alias spec in oci package
This allows Go to build third party packages correctly without vendoring
issues what want to create their own SpecOpts.

Fixes #2289

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-17 09:18:46 -04:00
Justin Cormack
062c3a00ef
Add a WithPrivileged OCI constructor and the options needed to build it
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-04-04 13:25:34 +01:00
Justin Cormack
0ee2f35e43
Consistently add empty types where they are nil in spec
In a few places we check for nil types when modifying a spec,
but in many cases we do not so we could get a panic if the
passed in type was not filled. Because the generated spec is
filled we will not notice this but users may get unexpected
panics.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-04-03 14:44:23 +01:00
Lantao Liu
00b600a605 Improve WithUser comments and code style.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-30 20:34:12 +00:00
Lantao Liu
45b0045593 Add oci.WithUser helper function.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-30 20:06:25 +00:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Brian Goff
c776b6d8d9 Use continuity fs package
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-07 12:40:52 -05:00
Michael Crosby
d179c61231 Revert "Use jsoniteer for faster json encoding/decoding"
This reverts commit 4233b87b89.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-29 15:47:48 -05:00
Michael Crosby
4233b87b89 Use jsoniteer for faster json encoding/decoding
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-26 16:32:55 -05:00
Michael Crosby
4e27c4d53d Add WithAllCapabilities as spec opt
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-26 14:31:32 -05:00
Michael Crosby
1f5ce14a82 Support getting uid/gid from rootfs path
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-16 14:48:29 -05:00
Michael Crosby
5b042945b0 Refactor get uid/gid from path
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-16 12:01:31 -05:00
Akihiro Suda
1645d8406d oci: simplify WithImageConfig
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-01-12 15:46:53 +09:00
Akihiro Suda
b99dc56817 oci: add TODO comments
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-01-12 15:36:18 +09:00
Akihiro Suda
369d7c9545 oci: fix err variable scope
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-01-12 15:36:18 +09:00
Derek McGowan
dfd7ee122f
Clean up error logs and messages in temp mount
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-01-05 15:37:11 -08:00
yanxuean
cb58bb885a solve incorrect unmount
1. add WithTempMount for better unmount and remove
2. solve incorrect unmount for
   diff.DiffMounts,
   diff.Apply,
   oci.WithUsername,
   oci.WithUserID,
   remapRootFS

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2018-01-06 00:28:16 +08:00
Michael Crosby
a8b543f87d rmdir tmp dirs for rootfs mounts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-04 13:51:11 -05:00
Michael Crosby
b0ca685874 Retry unmount on EBUSY and return errors
This is another WIP to fix #1785.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-04 11:31:08 -05:00
Michael Crosby
a4a4c90ed3 Use strconv.Atoi for uid/gid parsing
This follows the same logic that runc uses for parsing uid/gid values.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-30 15:22:41 -05:00
Stephen J Day
0d957b1da5
oci: allocate process if not already set
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-27 17:36:43 -08:00
Daniel Nephin
f6e877e8be Proposed fix for image content store
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-27 16:16:17 -05:00
Daniel Nephin
081f8c7ce0 oci package passing tests
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-27 16:14:43 -05:00