Commit Graph

24 Commits

Author SHA1 Message Date
Lantao Liu
808b223536 Fix race and panic.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-03-28 01:27:13 -07:00
Michael Crosby
388c8a1760 Fastpath opt and ExecProcess loading
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-22 12:08:43 -04:00
Michael Crosby
bdd84abf05 Add additional capability handling opts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-03-15 12:31:41 -04:00
Michael Crosby
84a24711e8 Add runc.v2 multi-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 11:09:46 -05:00
akolomentsev
f2344db40a do not mutate defaults in replaceOrAppendEnvValues
Signed-off-by: Andrey Kolomentsev <andrey.kolomentsev@docker.com>
2018-12-19 16:38:22 -08:00
akolomentsev
da9471fb11 fix oci.WithImageConfigArgs for windows
Signed-off-by: Andrey Kolomentsev <andrey.kolomentsev@docker.com>
2018-12-19 12:25:36 -08:00
Justin Terry (VM)
7ac221e8d7 Adding ctr memory and cpu flags
Adds ctr run --memory-limit for all platforms.
Adds ctr run --cpu-count for Windows platforms.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-12-10 13:31:59 -08:00
Justin Terry (VM)
223acbca2a Skip AdditionalGID's for LCOW oci spec
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-10-03 10:43:29 -07:00
Justin Terry (VM)
547bb94e4b Fix ctr run for Windows containers
1. Fixes bugs in ctr run that were introduced by 1d9b969
2. Adds support for the --isolated flag that runs Windows HyperV
cotainers instead of process isolated containers on Windows.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-09-20 14:28:36 -07:00
Derek McGowan
9faeea1e5e
Merge pull request #2649 from estesp/nonewpriv-flag
Add flag to ctr for running with "NoNewPrivileges: false"
2018-09-19 11:17:05 -07:00
Phil Estes
13931e41d6
Add additional GIDs by default if they exist in /etc/group
If we are using an image config, we should by default add any additional
GIDs that are found from reading /etc/group, even if the default user is
root.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-14 13:28:50 -04:00
Phil Estes
c28ce39cea
Add flag to ctr for running with NoNewPrivileges: false
Add flag and With-helper to set NoNewPrivileges to false since it is on
by default in the default UNIX spec for containerd, but off by default
in Docker and CRI plugin use. This allows for easy testing with it off
for comparison.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-14 11:03:58 -04:00
Lantao Liu
178db322b3 Support uid in WithAdditionalGIDs.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-13 10:51:14 -07:00
Phil Estes
78e61af47a
Add With-helper for supplemental gid support
Can be used to conform to Docker engine behavior of adding additional
GIDs to spec when found in /etc/group of image filesystem

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-11 23:01:15 -04:00
Justin Terry (VM)
ef910311e8 Add a Windows section for Linux oci on LCOW
When creating a default OCI spec on Windows that is targeting the LCOW
platform it needs to contain a Windows section as well. This adds the
Windows section by default. It also protects against this case for all
OCI creation that doesnt use the OCI package in the runhcs-shim.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-09-06 11:05:45 -07: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
Stephen Day
2a1bd7414b
oci: introduce WithSpecFromFile combinator
We introduce a WithSpecFromFile option combinator to allow creation
simpler creation of OCI specs from a file name. Often used as the first
option in a `SpecOpts` slice, it simplifies choosing between a local
file and the built-in default.

The code in `ctr run` has been updated to use the new option, with out
changing the order of operations or functionality present there.

Signed-off-by: Stephen Day <stephen.day@getcruise.com>
2018-07-27 14:25:42 -07: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
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
Justin Cormack
eab5d87af1 Fix typo in variable name
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2018-02-13 15:06:49 +00:00
Paul Knopf
b4c3cd7640
Add WithEnv and WithMount oci options
Signed-off-by: Paul Knopf <pauldotknopf@gmail.com>
2018-01-22 16:35:31 -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