Age | Commit message (Collapse) | Author |
|
* 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.
|
|
* 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
|
|
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.
|
|
Fixes #123.
|
|
* Added the 'expose' function to ContainerOptionBuilder impl. (Closes #73, Replaces #74)
* Forgot the , nevermind :ok_hand:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A few methods used some lifetimes that were too restrictive, so relax
them.
Fixes #64
|
|
|
|
|
|
|
|
|
|
Add InterlacedTty
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image.RepoTags seems to be optional (can be null)
|
|
Add details entries for container networks
|
|
Update to hyper 0.12
|
|
Remove swap fields from MemoryStat
|
|
These appear to be around since Docker Engine API v1.22:
https://docs.docker.com/engine/api/v1.22/
|
|
|
|
|
|
|
|
|
|
Solution to the MissingFieldError problem on /images/search.
|
|
feat: support --memory
|
|
Add Name field to inspect result
|
|
|
|
|
|
|
|
|
|
|
|
Tokio-core seems to be deprecated so remove it and use Tokio's Runtime
instead.
|
|
By making Unix sockets optional, hyperlocal becomes optional as well,
which means shiplift builds on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
support for --network= during build
|