Comments (1)
There already is support for stopping and starting a container. Here is a short example:
use docker_api::Docker;
let docker = Docker::unix("/var/run/docker.sock");
let containers = docker.containers();
let container = containers.get("<container-id-or-name>");
container.start().await;
// ... Do something with the container ...
container.stop(None).await;
// The None here is an optional duration to wait for the container to close
I just noticed that this actions are missing from the example file https://github.com/vv9k/docker-api-rs/blob/master/examples/container.rs so it I'll rename this issue to track the addition of those actions to the file.
from docker-api-rs.
Related Issues (20)
- Add integration tests for secrets api
- Add integration tests for swarm api
- Add integration tests for tasks api
- Add integration tests for services api
- Add integration tests for volumes api
- Image build takes time when build context is big HOT 7
- Linting issues during build
- Implementation can be derived error HOT 1
- TTY Option supresses stdout & stderr HOT 1
- Add tests for Container::attach
- Container TTY Resize HOT 6
- Upgrade to v1.42 API version HOT 3
- Add `βnet` option to container creation. HOT 2
- Stdin for Execs HOT 2
- Support for npipe protocol for connecting on Windows HOT 1
- The lifetime of `&self` in `Container::exec` shouldn't be tied to `'docker` HOT 4
- How to write to stdin of exec? HOT 4
- lifetime problem for log stream
- PortStatus not present in TaskStatusInlineItem
- is there an equivalent of `--file` as used through the Docker cli?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-api-rs.