We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
how can i use ‘--cpus’ directly
https://docs.docker.com/config/containers/resource_constraints/#cpu
The text was updated successfully, but these errors were encountered:
As it says in the docs, you'll need to use a combination of cpu_period and cpu_quota.
cpu_period
cpu_quota
I haven't tested it, but maybe something like:
let docker = Docker::connect_with_socket_defaults().unwrap(); const IMAGE: &'static str = "alpine:3"; docker .create_image( Some(CreateImageOptions { from_image: IMAGE, ..Default::default() }), None, None, ) .try_collect::<Vec<_>>() .await?; let alpine_config = Config { image: Some(IMAGE), tty: Some(true), host_config: Some(HostConfig { cpu_period: Some(100000), cpu_quota: Some(150000), ..Default::default() }), ..Default::default() }; let id = docker .create_container::<&str, &str>(None, alpine_config) .await? .id; docker.start_container::<String>(&id, None).await?;
Sorry, something went wrong.
@fussybeaver Hello I know the combination of --cpu_period and --cpu_quota. But it's a little cumbersome, I just want to use --cpus only .
--cpu_period
--cpu_quota
--cpus
No branches or pull requests
how can i use ‘--cpus’ directly
https://docs.docker.com/config/containers/resource_constraints/#cpu
The text was updated successfully, but these errors were encountered: