summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
AgeCommit message (Collapse)Author
2021-07-10Rename Config -> ContainerConfigwojciechkepka
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-12Fix incorrect return type of Networks::listJonas Pommerening
Moved and renamed NetworkInfo nee rep::Network to container::NetworkStats
2021-04-07Rename `IPAM` to `Ipam`Wojciech Kępka
2021-03-08Split up rep.rsEli W. Hunter
2021-03-08Split up builder.rsEli W. Hunter
2021-03-08Split up lib.rsEli W. Hunter
2021-03-08Merge pull request #273 from matthiasbeyer/fix-docMatthias Beyer
Fix: Dot should be in quotes
2021-03-08Merge pull request #277 from matthiasbeyer/add-safe-containers-getMatthias Beyer
Add Containers::get_checked() for getting an existing container
2021-03-08Add Containers::get_checked() for getting an existing containerMatthias Beyer
Containers::get() does always return a handle to a container, which might be invalid. This function checks whether the container exists before returning either a Some(Container) or None. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-06Add warning to Containers::get() methodMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-02-22Fix: Dot should be in quotesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-02-20Fix lifetimes (#272)Eli W. Hunter
* Some changes * Clarify lifetimes in transport.rs * Fix remaining easy lifetimes in lib.rs * Refactor Images::build for new lifetimes to work * Fix Exec::start() * Fix Container::exec() * Make header_bytes not a Vec * Make Docker::{images,...}() lifetimes explicit * Fix Containers::get() * Remove unnecessary locals from examples * Update changelog * Appease clippy
2021-02-08Add services api (#263)Wojciech Kępka
* Add initial Services models * Add initial Services controllers * Add ServicesListOptions * Rename ServicesList -> ServiceList * Fix some optional fields on ServiceRep * Add Service::inspect * Add Service::delete * Add Service::logs * Rename example logs -> containerlogs * Add ServiceOptions, ServiceCreateInfo, fix typo * Add a way to pass headers to request, add Payload and Headers for easier types * Add Service::create * Add examples * Fix fmt * Fix example
2021-02-06Simplify api, get rid of unnecessary lifetimes (#252)Wojciech Kępka
* Get rid of explicit lifetimes * more lifetimes ellided * Fix examples * Minor fix
2021-02-06Add Exec struct for easier manipulation of exec instances (#251)Wojciech Kępka
* Add ExecDetails and ProcessConfig * Add exec_with_id, exec_inspect * Add example how to inspect an exec instance * Make clippy happy * exit_code is an Option on ExecDetails * Add Exec struct * Update example * Fix typo * Add Exec::resize and ExecResizeOptions * Add resize example
2021-02-06Image::import argument tarball is now generic (#253)Wojciech Kępka
2021-01-15Upgrade all dependencies (#246)maowtm
* Upgrade dependencies and add required features * Special case for parsing unix:// url in Docker::new hyper::Uri doesn't allow urls with empty authority, hence parsing unix:///var/run/docker.sock will fail. * Remove empty /lib.rs * Fix cargo fmt
2021-01-09Allow `Image::pull` to handle chunks with multiple JSON values (#240)Tom Fay
* add fn for stream post that returns json values use when pulling docker images, to fix bug where shiplift would error if multiple JSON values were returned in a single HTTP chunk * fix unnecessary lazy evaluation * add comments to stream post requests
2021-01-09Implement upload of tar to container (#239)Dustin Frisch
* Implement upload of tar to container * Fixed typo Co-authored-by: Eli W. Hunter <42009212+elihunter173@users.noreply.github.com> Co-authored-by: Eli W. Hunter <42009212+elihunter173@users.noreply.github.com>
2020-09-01Implement multiple chunk streams in build function for images (#232)Hampus Lidin
Co-authored-by: Hampus Lidin <hampus.lidin@astrazeneca.com>
2020-07-23Async/Await Support (continuation of #191) (#229)Eli W. Hunter
* it builds! * remove unused dependencies * bump dependencies * reimplement 'exec' endpoint * update a few more examples * update remaining examples * fix doc tests, remove unused 'read' module * remove feature-gated async closures * split futures dependency to just 'futures-util' * update version and readme * make functions accepting Body generic over Into<Body> again * update changelog * reinstate 'unix-socket' feature * reinstate 'attach' endpoint * fix clippy lints * fix documentation typo * fix container copyfrom/into implementations * add convenience methods for TtyChunk struct * remove 'main' from code example to silence clippy lint * Update hyper to 0.13.1 * Add Send bounds to TtyWriter * Appease clippy * Fix examples * Update issue in changelog Co-authored-by: Daniel Eades <danieleades@hotmail.com> Co-authored-by: Marc Schreiber <marc.schreiber@aixigo.de>
2020-03-19appease clippy (#225)Colvin Wellborn
2019-12-26Re-export hyper::Uri as shiplift::Uri (#209)Thomas Eizinger
This patch removes the explicit dependency on the http crate and instead accesses the re-exported version of hyper. This should make the update process slightly easier because those versions would need to be kept in sync manually. We also re-export hyper::Uri as shiplift::Uri because it is part of the public API of shiplift::Docker. This allows users to access the Uri type without having to seperately depend on http or hyper.
2019-12-05Replace host str to use https if encrypted (#193)Lucio Franco
* Replace host str to use https if encrypted * Add comment and fmt
2019-09-15Use 'dyn' since trait objects without an explicit 'dyn' are deprecated (#194)Atul Bhosale
2019-08-10Added function to tag an image (#187)MHamill98
* Added function to tag an image * Removed debug and println
2019-06-01copy_file_into creates sub-directories if required (#171)Marc Schreiber
2019-05-31Fix build image response parsing error (#177)Sergey Tsaplin
2019-05-17Add import functionality (#165)Keir Lawson
2019-05-17Switch path type requirement to make more ergonomic (#168)Keir Lawson
2019-03-30Add a registry authentication. (#157)Anton Ageev
2019-02-25Apply rust format to fix CI checks (#153)Marc Schreiber
2019-02-25Support multiple messages per chunk in streaming image pull (#154)Austin Brown
2019-02-23Copy a byte slice as file into a container (#151)Marc Schreiber
- add function copy_file_into to container - add example
2019-02-13Copy from container (#150)Andy Caldwell
* Add 'copy_from' function to 'Container' * Run clippy * Update deps
2019-01-08Make TLS/openssl an optional dependency (#130)rsdy
2018-12-24render idsoftprops
2018-12-24maint detailssoftprops
2018-12-24update to 2018 edition (#141)doug tangren
* update to 2018 edition * remove more externs * bump version
2018-12-23update travis build (#140)doug tangren
* update travis build * notes on fmting * remove quotes * comment below * rouge quote * first host.port usage * fix deprecation warning
2018-12-22Remove an unused type parameter from the 'nocache' function (#135)Dylan McKay
* Remove an unused type parameter from the 'nocache' function The function is currently unusable because the type parameter has no uses or bounds. * Fix existing rustfmt violation Semicolons need to be added to return statements. Without this, the build fails. * Replace call of Uri::port to Uri::port_part The former is deprecated in favor of the latter. This causes a deprecation warning when compiling shiplift. This patch fixes the deprecation warning.
2018-12-22feat: create, list, and delete volumes (#138)Marc Schreiber
2018-12-22Support interactive stdin/stdout streams (#136)Dylan McKay
* Support interactive stdin/stdout streams This adds support for streaming stdin, stderr, and stdout independently to a running container. The underlying API is futures-based, meaning the code is implemented asynchronously. A synchronous API is also exposed, which is implemented by simply waiting on the asynchronous API futures. This also modifies the existing Tty logic so that the storage type of the data is a Vec<u8> rather than a String. This is also how the Rust standard library persists data from the standard streams. In my particular application, I'm using stdin/stdout as the communication method between a container a host application. In it, a byte-based protocol is used. Streaming works by performing a TCP upgrade; upgrading a higher-level HTTP connection to a lower-level TCP byte stream upon agreement with the server. Docker will automatically upgrade HTTP container log requests to TCP byte streams of a custom std{in,out,err} multiplexing protocol if the client requests it with the 'Connection: Upgrade' header. * Return an error rather than panic when Docker refuses to upgrade to TCP * Add interpret-as-string accessors to tty::Chunk Also updates the examples to use them.
2018-11-14Async api (#128)Antoine Büsch
* Refactored Transport for better async use Still a bit rough, but it now builds a big future using combinators. It still does one `Runtime::block_on()` to keep the existing API, but this is a first up before making the whole API async. * Migrate most APIs to be Future-based I still need to finish a few of the more tricky ones that I've commented out for now, but most of it compiles and some examples work. In particular, `Docker::stats()` now properly returns an async stream of stats. * Fix events and containerinspect examples * Fix imageinspect, images, info and top examples * Fix containercreate, imagedelete and imagepull examples * Fix more examples * Add back debug statement in Transport::request * De-glob imports in examples * Remove unused imports in examples * Fix NetworkCreateOptions serialization * Add back error message extraction in Transport * Fix Container::create serialization of options * Add containerdelete example * Simplify result * Fix some error handling to remove unwrap() * Fix Image::export() * Fix imagebuild example * Add adapter from Stream of Chunks to AsyncRead Having an `AsyncRead` is required to be able to use the `FramedRead` and `Decoder` stuff from tokio_codec. This code is "borrowed" from https:/github.com/ferristseng/rust-ipfs-api though should probably be moved to its own crate or to tokio_codec. * Fix Container::logs() It now properly demuxes stdout/stderr, and returns a `Stream<Item = TtyLine>`. * Fix Container::export() * Use LineCodec for streaming JSON Although in my limited testing it seemed to work fine, there is no guarantee that 1 chunk == 1 piece of valid JSON. However, each JSON structure seems to be serialized on one line, so use LineCodec to turn the body into a stream of lines, then deserialize over this. * Fix serialization of ExecContainerOptions * Fix Container::exec() (kind of...) * Simplify deserialisation in Image::delete() * Small clean-ups * More clean ups * Fix rustdoc + remove extraneous "extern crate" * Fix doc example * Fix formatting
2018-11-14Disable Hyper's http protocol enforcement. (#129)David Wood
There are some situations where the Docker daemon will expose a HTTP server and will expect connections through a TCP connection rather than via a unix socket. For example, this is the case with Docker for Windows when used through the Windows Subsystem for Linux. In these cases, `DOCKER_HOST` will be of the form `tcp://127.0.0.1:2375`. Docker will not work if `DOCKER_HOST` has the `http` protocol. This commit manually builds a `HttpConnector` from Hyper so that it does not fail if the protocol is not `http`. Therefore, the `DOCKER_HOST` that works with Docker will also work with shiplift.
2018-10-17serde can't read a Vec<Value> from a stream (#126)Chris West
Fixes #123.
2018-10-17[OK] Expose port (#127)Nurrl
* Added the 'expose' function to ContainerOptionBuilder impl. (Closes #73, Replaces #74) * Forgot the , nevermind :ok_hand:
2018-10-13Fixed error causing bad json to be sent to Docker API. (#124)Nurrl
2018-10-10fix a number of clippy warnings (#122)doug tangren
2018-10-09Merge branch 'master' into fix_lifetimesAntoine Büsch