-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]Fix the --runtime option of container create to support path #2411
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for --runtime=/usr/local/bin/crun
, --runtime=runsc
, etc.
a1dfb02
to
e7b91a5
Compare
pkg/cmd/container/run_runtime.go
Outdated
if !strings.HasPrefix(runtimeStr, "io.containerd.runc.") { | ||
if cgroupManager == "systemd" { | ||
logrus.Warnf("cannot set cgroup manager to %q for runtime %q", cgroupManager, runtimeStr) | ||
} | ||
runtimeOpts = nil | ||
} | ||
} else { | ||
} else if filepath.IsAbs(runtimeStr) { | ||
// runtimeStr is a runc binary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why runtimeStr
is a runc
binary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support --runtime=/usr/local/bin/crun
, --runtime=runsc
, etc.
(runc-compatible third-party runtime binaries are called "runc binary" here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--runtime=runsc
is not absolute path
5218242
to
2c8aa16
Compare
test is failing
|
2c8aa16
to
88a0813
Compare
88a0813
to
9bbe3ea
Compare
d78d883
to
ef8f1c9
Compare
Signed-off-by: Kay Yan <[email protected]>
do we have the same behavior as docker ? |
No, Docker needs explicit configuration in daemon.json. For nerdctl, we support strings like
|
@@ -47,6 +48,9 @@ func generateRuntimeCOpts(cgroupManager, runtimeStr string) ([]containerd.NewCon | |||
} | |||
runtimeOpts = nil | |||
} | |||
} else if filepath.IsAbs(runtimeStr) { | |||
// runtimeStr is absolute path to runtime binary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runc-compatible binary should be assumed unless the binary name is composed of reversed domains
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also consider “CSV” values like “type=runc,path=foo”, “type=containerd,name=com.example.foo.v1”, “type=containerd,path=containerd-shim-foo-v1”
I mean this behavior
|
@yankay PTAL |
hey @yankay ! Wondering if this is still something you are interested in carrying through? |
Description
Unlike ctr , the nerdctl does not support the
--runtime
flag while creating a container with pathSteps to reproduce the issue
After the fix.
The runtime flag with path can be configed successfully.
And it can run sucessfuly: