diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -30,7 +30,7 @@ pub use crate::{ BuildOptions, ContainerConnectionOptions, ContainerFilter, ContainerListOptions, ContainerOptions, EventsOptions, ExecContainerOptions, ImageFilter, ImageListOptions, LogsOptions, NetworkCreateOptions, NetworkListOptions, PullOptions, RegistryAuth, - RmContainerOptions, VolumeCreateOptions, + RmContainerOptions, TagOptions, VolumeCreateOptions, }, errors::Error, }; @@ -113,6 +113,18 @@ impl<'a, 'b> Image<'a, 'b> { .stream_get(&format!("/images/{}/get", self.name)[..]) .map(|c| c.to_vec()) } + + /// Adds a tag to an image + pub fn tag( + &self, + opts: &TagOptions, + ) -> impl Future<Item = (), Error = Error> { + let mut path = vec![format!("/images/{}/tag", self.name)]; + if let Some(query) = opts.serialize() { + path.push(query) + } + self.docker.post::<Body>(&path.join("?"), None).map(|_| ()) + } } /// Interface for docker images |