haoyun
bbe46b8c43
feat: replace github.com/pkg/errors to errors
...
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
Markus Lehtonen
9e755d12e2
cmd: add --rdt-class command line option
...
A new option for setting the RDT class (or CLOS) from the command line.
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lippert
f39b3ac7ea
fix(ctr): enable networking for Windows containers
...
Signed-off-by: Markus Lippert <lippertmarkus@gmx.de>
2021-12-21 07:13:39 +01:00
Manabu Sugimoto
95b3ab2a4a
ctr: Add Linux Capabilities control flags
...
This allows Linux Capabilities to be modified via `ctr`.
e.g.
```
$ sudo ./bin/ctr run --cap-add "CAP_SYS_ADMIN" --cap-drop "CAP_NET_RAW" \
--rm docker.io/library/busybox:latest foo cat /proc/self/status | grep Cap
CapInh: 00000000a82405fb
CapPrm: 00000000a82405fb
CapEff: 00000000a82405fb
CapBnd: 00000000a82405fb
CapAmb: 0000000000000000
```
Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2021-11-25 14:50:43 +09:00
Phil Estes
f40df3d72b
Enable image config labels in ctr and CRI container creation
...
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-09-15 15:31:19 -04:00
Akihiro Suda
d3aa7ee9f0
Run go fmt
with Go 1.17
...
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools ).
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Michael Crosby
6f60b3016f
[ctr] add HOSTNAME env for host network
...
Set the hostname environment var when using host networking via ctr
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-08-18 14:42:36 +00:00
Fu Wei
1c4e9d0487
Merge pull request #5846 from crosbymichael/ctr-cpu.shares
2021-08-11 09:24:00 +08:00
Michael Crosby
d2f3b71468
add cpu-shares to ctr
...
This allows the cpu shares to be modified via ctr.
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-08-10 04:12:15 -04:00
Yifan Yuan
bda7b58666
feat: Add snapshotter label to the new snapshot for container.
...
add '--snapshotter-labels' in ctr run and ctr c create
which can pass labels to snappshotter on preparing new
snapshot.
Pass command label to snapshotter can help it determine
which kind of writable snapshots should be provide.
For some snapshotter, such as overlaybd:
( https://github.com/alibaba/accelerated-container-image ),
it can provide 2 kind of writable snapshot (overlayfs dir or
blockdevice) by command label values.
Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
2021-06-28 20:08:01 +08:00
Fu Wei
1daea57ab5
Merge pull request #5636 from crosbymichael/multi-gpus
...
allow multi gpu to be specified via ctr
2021-06-23 00:08:48 +08:00
Michael Crosby
09d78bb6b9
allow multi gpu to be specified via ctr
...
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-06-21 23:49:43 -04:00
kh
05e51539a9
command line flags of setting container rootfs propagation
...
Signed-off-by: Kitt Hsu <kitt.hsu@gmail.com>
2021-06-17 10:03:37 +08:00
Brian Goff
7776e5ef2a
Support adding devices by dir
...
This enables cases where devices exist in a subdirectory of /dev,
particularly where those device names are not portable across machines,
which makes it problematic to specify from a runtime such as cri.
Added this to `ctr` as well so I could test that the code at least
works.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-03-15 16:42:23 +00:00
Shengjing Zhu
2818fdebaa
Move runtimeoptions out of cri package
...
Since it's a standard set of runtime opts, and used in ctr as well,
it could be moved out of cri.
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2021-01-23 01:24:35 +08:00
Michael Crosby
5f74840a9a
Merge pull request #4709 from AkihiroSuda/ctr-apparmor
...
ctr: add AppArmor flags
2020-11-10 10:21:51 -05:00
Akihiro Suda
9d54648be3
ctr: add AppArmor flags
...
e.g.
```
$ sudo ./bin/ctr run --apparmor-default-profile "cri-containerd.apparmor.d" docker.io/library/alpine:latest foo cat /proc/self/attr/current
cri-containerd.apparmor.d (enforce)
```
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-10 14:19:35 +09:00
Evan Hazlett
ef48ef1e4c
add config path option to ctr for runtime
...
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2020-10-29 15:21:37 +00:00
Michael Crosby
21b6f68765
Add CNI support to ctr run
...
This adds linux cni support to `ctr run` via a `--cni` flag. This uses the
default configuration for CNI on `ctr` to configure the network namespace for a
container.
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-10-14 22:37:53 -04:00
Qian Xiao
469b637358
Fix ctr command typo.
...
Signed-off-by: Qian Xiao <heyheyco@gmail.com>
2020-09-07 15:50:52 -07:00
Shishir Mahajan
1eae524df6
ctr: CLI Flag (seccomp-profile) for setting custom seccomp profile.
...
Signed-off-by: Shishir Mahajan <smahajan@roblox.com>
2020-09-02 16:13:11 -07:00
Michael Crosby
db687ff485
Add --runtime-root to ctr
...
Signed-off-by: Michael Crosby <michael@thepasture.io>
2020-08-21 04:55:28 -04:00
kenneth.kang
e20a5079e8
Add --cpu-quota, --cpu-period flag to ctr
...
Signed-off-by: Kenneth Kang <kenneth.kang@lge.com>
2020-08-06 10:04:59 +09: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
Sherif
96099550b5
parseIDMapping: accept 32-bit IDs
...
Signed-off-by: Sherif Mowafy <sherif.mowafy@gmail.com>
2020-07-19 10:09:51 +02:00
Phil Estes
45c28f56b2
Add ability to use remapper labels versus remapping snapshot helper
...
A simple starting point for testing the remapper labels with
fuse-overlayfs snapshotter
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2020-06-29 10:21:55 -04:00
Peng Tao
ebd745f91a
ctr: do not assume runc options by default
...
If runtime is not runc, it doesn't make sense to send runc Options
as container create options, which will confuse other runtimes and
it actually causes kata shimv2 to fail to unmarshal the requset.
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-03-24 18:45:34 +08:00
Phil Estes
fa62b6d238
Use logrus instead of printf for warning
...
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-12-12 19:33:04 -05:00
Jie Hao Liao
9862cb8f85
support user remapping in ctr
...
* --uidmap support for one remapping
* --gidmap support for one remapping
* create IoUid and IoGid options for getNewTaskOpts
Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com>
2019-12-12 01:16:47 -06:00
Jie Hao Liao
787be0efe2
Modify ctr run to search for read-only flag instead of readonly
...
Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com>
2019-12-04 02:18:23 -06:00
Akihiro Suda
8f74de9e9e
ctr: allow specifying --runc-systemd-cgroup
...
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-08 14:06:08 +09:00
Akihiro Suda
7f5d900769
ctr: allow specifying --runc-binary
...
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2019-11-08 14:06:08 +09: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
fa11147e5f
Add --env-file to ctr
...
Closes #3517
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-06 16:25:02 -04:00
Michael Crosby
779701b29c
Add --seccomp flag to ctr
...
This enables testing of containers with the default seccomp profile
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-29 13:02:21 -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
Derek McGowan
a274dbe822
Fix run with specified platform
...
Adds the platform flag to the run command and resolves
the image based on that platform.
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-05-23 11:59:33 -07: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
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)
f90e5d564a
Move ctr run --isolation to Windows only
...
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2018-11-23 17:11:59 -08:00
Evan Hazlett
40caece8dc
update tests
...
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:17 +00:00
Akihiro Suda
dd0539b095
ctr: add --cgroup for oci.WithCgroup
...
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-11-06 17:39:30 +09:00
Samuel Karp
607888ce29
ctr: make kill use stop-signal by default
...
The OCI image specification includes a `StopSignal` field in the image
configuration, denoting the system call signal to be sent to the
container to exit. This commit adds a new `WithImageStopSignal` container
option that can be used for storing the `StopSignal` field as a label on
the container. This commit also adjusts `ctr run` to call
`WithImageStopSignal` and `ctr tasks kill` to send the signal stored in
that label by default.
Signed-off-by: Samuel Karp <skarp@amazon.com>
2018-09-27 15:53:38 -07:00
Phil Estes
41615e8ded
Remove a TODO from the code comments that is complete
...
WithUser... helpers do support non-snapshot rootfs now.
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-20 09:07:36 -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
Michael Crosby
1597270d04
Merge pull request #2579 from lifubang/ctrrun
...
fix when --config provided, don't need Image/RootFS
2018-09-10 13:09:08 -04:00
Lifubang
48fe63511a
code optimization after review
...
Signed-off-by: Lifubang <lifubang@acmcoder.com>
2018-09-05 23:36:31 +08:00
Lifubang
1d9b96988f
fix when --config provided, don't need Image/RootFS
...
Signed-off-by: Lifubang <lifubang@aliyun.com>
2018-08-27 11:18:25 +08:00
Lifubang
dc6ed04ff5
support relative rootfs path in ctr
...
Signed-off-by: Lifubang <lifubang@aliyun.com>
2018-08-24 07:56:37 +08: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