Coder Social home page Coder Social logo

boondock's People

Contributors

blkpark avatar dudymas avatar emk avatar griff avatar innectic avatar khuey avatar psftw avatar stephanbuys avatar tailhook avatar tobz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boondock's Issues

Create container keeps returning 'EOF'

Hi, i'm having an issue with the container creation method on the 'feature/containers' branch here Docker keeps returning 'EOF' even though my headers and body are present. I've tested it with Postman and it works properly.

Is there anybody know what to do?

Thank you

A better documentation with examples.

Hi, I saw the examples, but there is no way I can understand any of the code, for example, I want to make a container from an image, there is no documentation for this !
For sure I can help if needed !
Edit: I saw there is no support for creating containers :c

Upgrade to a modern HTTP client with portable HTTPS support

Right now, we rely on OpenSSL to handle https, which means that we need to special-case everything for the Mac. Ideally, this would mean using native-tls, which would in turn involve replacing our ancient hyper with reqwest.

Unfortunately...

We need to handle non-TCP Docker sockets, which means we're providing a custom network transport. And reqwest doesn't support this. At the moment, we use:

  • unix_socket for Unix-like systems. This is synchronous only, but it might be possible to switch to hyperlocal.
  • named_pipe for Windows. This might be replaced with something based on mio-named-pipes.

So there's probably a moderate amount of hyper-related code to get us talking securely to Docker again.

Support `docker exec`

This would be really useful to my project.
I don't know if you have any plan for this, maybe it's out of scope for cage.
I tried to give a quick look at docker's client source code, but wasn't able to find where magic really happens.

Docker connection mechanism error handling fail.

So I've been using the lib like so :

user@computer: ~$ cat src/main.rs 
extern crate boondock;
use boondock::Docker;

fn main() {
    let docker = Docker::connect_with_defaults().unwrap();
}
user@computer: ~$ # No docker on my computer, the program should panic because of the .unwrap().
user@computer: ~$ which docker
user@computer: ~$ # Nor the default socket
user@computer: ~$ ls /var/run/docker.sock
ls: cannot access '/var/run/docker.sock': No such file or directory
user@computer: ~$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
     Running `target/debug/opendd`
user@computer: ~$ # Unfortunately, no crash .-.
user@computer: ~$

Maybe I don't understand, but it's pretty straight forward to me that this should crash because connect_with_defaults() returns a Result<Docker>.

Bump openssl dependency

This is a headsup that the current openssl dependency is outdated and doesn't compile on my system anymore. :) I'm currently on openssl 1.1.0.g

Fix all warnings in code base

The Rust compiler has changed a lot since this code was last worked on, and there are a lot of warnings when this code is compiled now. We need to clean these up.

Pass expected protocol versions to Docker?

Looking at the Docker source code, it seems like the daemon actually supports multiple protocol versions. Is there some way to tell it what version we're expecting to see?

docs.rs build is failing

docs.rs cannot build the docs for boondock. The error seem to be related to openssl.

Are the docs stored someplace else?

Here is the log from docs.rs

--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-o" "/home/cratesfyi/cratesfyi/debug/build/openssl-56b1b41302837114/out/src/c_helpers.o" "-c" "src/c_helpers.c"
cargo:warning=src/c_helpers.c: In function ‘rust_SSL_clone’:
cargo:warning=src/c_helpers.c:4:5: warning: implicit declaration of function ‘CRYPTO_add’ [-Wimplicit-function-declaration]
cargo:warning=     CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning=     ^~~~~~~~~~
cargo:warning=src/c_helpers.c:4:20: error: dereferencing pointer to incomplete type ‘SSL {aka struct ssl_st}’
cargo:warning=     CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning=                    ^~
cargo:warning=src/c_helpers.c:4:37: error: ‘CRYPTO_LOCK_SSL’ undeclared (first use in this function)
cargo:warning=     CRYPTO_add(&ssl->references, 1, CRYPTO_LOCK_SSL);
cargo:warning=                                     ^~~~~~~~~~~~~~~
cargo:warning=src/c_helpers.c:4:37: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/c_helpers.c: In function ‘rust_SSL_CTX_clone’:
cargo:warning=src/c_helpers.c:8:20: error: dereferencing pointer to incomplete type ‘SSL_CTX {aka struct ssl_ctx_st}’
cargo:warning=     CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
cargo:warning=                    ^~
cargo:warning=src/c_helpers.c:8:35: error: ‘CRYPTO_LOCK_SSL_CTX’ undeclared (first use in this function)
cargo:warning=     CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);
cargo:warning=                                   ^~~~~~~~~~~~~~~~~~~
cargo:warning=src/c_helpers.c: In function ‘rust_X509_clone’:
cargo:warning=src/c_helpers.c:12:21: error: dereferencing pointer to incomplete type ‘X509 {aka struct x509_st}’
cargo:warning=     CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
cargo:warning=                     ^~
cargo:warning=src/c_helpers.c:12:36: error: ‘CRYPTO_LOCK_X509’ undeclared (first use in this function)
cargo:warning=     CRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);
cargo:warning=                                    ^~~~~~~~~~~~~~~~
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-o" "/home/cratesfyi/cratesfyi/debug/build/openssl-56b1b41302837114/out/src/c_helpers.o" "-c" "src/c_helpers.c" with args "cc" did not execute successfully (status code exit code: 1).

', .cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.54/src/lib.rs:1670:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: failed to run custom build command for `openssl-sys-extras v0.7.14`
process didn't exit successfully: `/home/cratesfyi/cratesfyi/debug/build/openssl-sys-extras-abe14868179e9a5e/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-Wall" "-Wextra" "-o" "/home/cratesfyi/cratesfyi/debug/build/openssl-sys-extras-e60f1107e2e04baa/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
cargo:warning=src/openssl_shim.c: In function ‘SSL_CTX_set_ecdh_auto_shim’:
cargo:warning=src/openssl_shim.c:121:41: warning: unused parameter ‘ctx’ [-Wunused-parameter]
cargo:warning= int SSL_CTX_set_ecdh_auto_shim(SSL_CTX *ctx, int onoff) {
cargo:warning=                                         ^~~
cargo:warning=src/openssl_shim.c: In function ‘DH_new_from_params’:
cargo:warning=src/openssl_shim.c:132:7: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
cargo:warning=     dh->p = p;
cargo:warning=       ^~
cargo:warning=src/openssl_shim.c: In function ‘X509_get_extensions_shim’:
cargo:warning=src/openssl_shim.c:143:13: error: dereferencing pointer to incomplete type ‘X509 {aka struct x509_st}’
cargo:warning=     return x->cert_info ? x->cert_info->extensions : NULL;
cargo:warning=             ^~
cargo:warning=src/openssl_shim.c:144:1: warning: control reaches end of non-void function [-Wreturn-type]
cargo:warning= }
cargo:warning= ^
exit code: 1

How to inspect stats when a kernel feature is disabled?

Hi Folks,

In these days, much of the linux kernels running doesnt have the Cgroup Swap support activated and because of this, there is no field called 'swap' for the container stats. When I try to gather some container stats with the following code

    for container in &containers {
        let _stats = match docker.stats(container) {
            Ok(stats) => stats,
            Err(e) => { panic!("{}", e); }
        };

        for stat in _stats{
            println!("{:?}", stat);
        }
    }

It returns to me the message "(Some(Error("missing field swap", line: 1, column: 4183)), None)))".

Thanks in advance.

Add `ps --filter` (and maybe `--last <N>`) features

docker ps has some options for filtering the containers it returns:

Usage:  docker ps [OPTIONS]

List containers

Options:
  -a, --all             Show all containers (default shows just running)
  -f, --filter value    Filter output based on conditions provided (default [])
      --format string   Pretty-print containers using a Go template
      --help            Print usage
  -n, --last int        Show n last created containers (includes all states) (default -1)
  -l, --latest          Show the latest created container (includes all states)
      --no-trunc        Don't truncate output
  -q, --quiet           Only display numeric IDs
  -s, --size            Display total file sizes

If any of these correspond to flags in the underlying protocol, we may want to implement them. See also #4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.