[−][src]Struct dockworker::Docker
Handle to connection to the docker daemon
Methods
impl Docker
[src]
pub fn set_credential(&mut self, credential: Credential)
[src]
pub fn connect_with_defaults() -> Result<Docker>
[src]
Connect to the Docker daemon
Summary
Connect to the Docker daemon using the standard Docker configuration options. This includes:
DOCKER_HOST
DOCKER_TLS_VERIFY
DOCKER_CERT_PATH
DOCKER_CONFIG
and we try to interpret these as much like the standard docker
client as possible.
pub fn connect_with_unix(addr: &str) -> Result<Docker>
[src]
This ensures that using a fully-qualified path
e.g. unix://.... -- works. The unix socket provider expects a Path, so we don't need scheme.
pub fn connect_with_ssl(
_addr: &str,
_key: &Path,
_cert: &Path,
_ca: &Path
) -> Result<Docker>
[src]
_addr: &str,
_key: &Path,
_cert: &Path,
_ca: &Path
) -> Result<Docker>
pub fn connect_with_http(addr: &str) -> Result<Docker>
[src]
Connect using unsecured HTTP. This is strongly discouraged everywhere but on Windows when npipe support is not available.
pub fn list_containers(
&self,
all: Option<bool>,
limit: Option<u64>,
size: Option<bool>,
filters: ContainerFilters
) -> Result<Vec<Container>>
[src]
&self,
all: Option<bool>,
limit: Option<u64>,
size: Option<bool>,
filters: ContainerFilters
) -> Result<Vec<Container>>
pub fn containers(&self, opts: ContainerListOptions) -> Result<Vec<Container>>
[src]
pub fn create_container(
&self,
name: Option<&str>,
option: &ContainerCreateOptions
) -> Result<CreateContainerResponse>
[src]
&self,
name: Option<&str>,
option: &ContainerCreateOptions
) -> Result<CreateContainerResponse>
Create a container
Summary
name
- None: auto namingoption
- create options
API
POST /containers/create?{name}
pub fn start_container(&self, id: &str) -> Result<()>
[src]
pub fn stop_container(&self, id: &str, timeout: Duration) -> Result<()>
[src]
pub fn kill_container(&self, id: &str, signal: Signal) -> Result<()>
[src]
pub fn restart_container(&self, id: &str, timeout: Duration) -> Result<()>
[src]
pub fn attach_container(
&self,
id: &str,
detachKeys: Option<&str>,
logs: bool,
stream: bool,
stdin: bool,
stdout: bool,
stderr: bool
) -> Result<AttachResponse>
[src]
&self,
id: &str,
detachKeys: Option<&str>,
logs: bool,
stream: bool,
stdin: bool,
stdout: bool,
stderr: bool
) -> Result<AttachResponse>
Attach to a container
Attach to a container to read its output or send it input.
API
/containers/{id}/attach
pub fn exec_container(
&self,
id: &str,
option: &CreateExecOptions
) -> Result<CreateExecResponse>
[src]
&self,
id: &str,
option: &CreateExecOptions
) -> Result<CreateExecResponse>
Create Exec instance for a container
Run a command inside a running container.
API
/containers/{id}/exec
pub fn start_exec(
&self,
id: &str,
option: &StartExecOptions
) -> Result<AttachResponse>
[src]
&self,
id: &str,
option: &StartExecOptions
) -> Result<AttachResponse>
Start an exec instance
Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.
API
/exec/{id}/start
pub fn exec_inspect(&self, id: &str) -> Result<ExecInfo>
[src]
pub fn log_container(
&self,
id: &str,
option: &ContainerLogOptions
) -> Result<LogResponse>
[src]
&self,
id: &str,
option: &ContainerLogOptions
) -> Result<LogResponse>
pub fn container_top(&self, container: &Container) -> Result<Top>
[src]
pub fn processes(&self, container: &Container) -> Result<Vec<Process>>
[src]
pub fn stats(&self, container: &Container) -> Result<StatsReader>
[src]
pub fn wait_container(&self, id: &str) -> Result<ExitStatus>
[src]
pub fn remove_container(
&self,
id: &str,
volume: Option<bool>,
force: Option<bool>,
link: Option<bool>
) -> Result<()>
[src]
&self,
id: &str,
volume: Option<bool>,
force: Option<bool>,
link: Option<bool>
) -> Result<()>
pub fn get_file(&self, id: &str, path: &Path) -> Result<Archive<Box<dyn Read>>>
[src]
pub fn put_file(
&self,
id: &str,
src: &Path,
dst: &Path,
noOverwriteDirNonDir: bool
) -> Result<()>
[src]
&self,
id: &str,
src: &Path,
dst: &Path,
noOverwriteDirNonDir: bool
) -> Result<()>
Extract an archive of files or folders to a directory in a container
Summary
Extract given src file into the container specified with id. The input file must be a tar archive with id(no compress), gzip, bzip2 or xz.
- id : container name or ID
- src : path to a source file
- dst : path to a directory in the container to extract the archive's contents into
API
/containers/{id}/archive
pub fn build_image(
&self,
options: ContainerBuildOptions,
tar_path: &Path
) -> Result<Response>
[src]
&self,
options: ContainerBuildOptions,
tar_path: &Path
) -> Result<Response>
pub fn create_image(
&self,
image: &str,
tag: &str
) -> Result<Box<dyn Iterator<Item = Result<DockerResponse>>>>
[src]
&self,
image: &str,
tag: &str
) -> Result<Box<dyn Iterator<Item = Result<DockerResponse>>>>
Create an image by pulling it from registry
API
/images/create?fromImage={image}&tag={tag}
NOTE
When control returns from this function, creating job may not have been completed.
For waiting the completion of the job, consuming response like
create_image("hello-world", "linux").map(|r| r.for_each(|_| ()));
.
TODO
- Typing result iterator like image::ImageStatus.
- Generalize input parameters
pub fn inspect_image(&self, name: &str) -> Result<Image>
[src]
pub fn push_image(&self, name: &str, tag: &str) -> Result<()>
[src]
Push an image
NOTE
For pushing an image to non default registry, add registry id to prefix of the image name like <registry>/<image>
.
But the name of the local cache image is <image>:<tag>
.
API
/images/{name}/push
pub fn remove_image(
&self,
name: &str,
force: Option<bool>,
noprune: Option<bool>
) -> Result<Vec<RemovedImage>>
[src]
&self,
name: &str,
force: Option<bool>,
noprune: Option<bool>
) -> Result<Vec<RemovedImage>>
pub fn prune_image(&self, dangling: bool) -> Result<PrunedImages>
[src]
pub fn history_image(&self, name: &str) -> Result<Vec<ImageLayer>>
[src]
pub fn images(&self, all: bool) -> Result<Vec<SummaryImage>>
[src]
pub fn export_image(&self, name: &str) -> Result<Box<dyn Read>>
[src]
pub fn load_image(&self, quiet: bool, path: &Path) -> Result<ImageId>
[src]
pub fn auth(
&self,
username: &str,
password: &str,
email: &str,
serveraddress: &str
) -> Result<AuthToken>
[src]
&self,
username: &str,
password: &str,
email: &str,
serveraddress: &str
) -> Result<AuthToken>
Check auth configuration
API
/auth
NOTE
In some cases, docker daemon returns an empty token with 200 Ok
.
The empty token could not be used for authenticating users.
pub fn system_info(&self) -> Result<SystemInfo>
[src]
pub fn container_info(&self, container: &Container) -> Result<ContainerInfo>
[src]
pub fn filesystem_changes(
&self,
container: &Container
) -> Result<Vec<FilesystemChange>>
[src]
&self,
container: &Container
) -> Result<Vec<FilesystemChange>>
Get changes on a container's filesystem.
(This is the same as docker container diff
command.)
API
/containers/{id}/changes
pub fn export_container(&self, container: &Container) -> Result<Box<dyn Read>>
[src]
pub fn ping(&self) -> Result<()>
[src]
pub fn version(&self) -> Result<Version>
[src]
pub fn events(
&self,
since: Option<u64>,
until: Option<u64>,
filters: Option<EventFilters>
) -> Result<Box<dyn Iterator<Item = Result<EventResponse>>>>
[src]
&self,
since: Option<u64>,
until: Option<u64>,
filters: Option<EventFilters>
) -> Result<Box<dyn Iterator<Item = Result<EventResponse>>>>
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,