vv9k / docker-api-rs

Rust interface to Docker containers
MIT License
106 stars 33 forks source link

Add more `ContainerCreateOptsBuilder` parameters #51

Closed D-Brox closed 1 year ago

D-Brox commented 1 year ago

What did you implement:

I added the parameters Hostname,Domainname,IpcMode and PidMode to ContainerCreateOptsBuilder, needed for container-host integration in my use-case, following the Docker API documentation.

How did you verify your change:

I created a container with the new parameters and checked the behavior using docker inspect

let opts = ContainerCreateOpts::builder()
    .name("opt-test")
    .hostname("host")
    .domainname("host")
    .ipc("host")
    .pid("host")
    .build();
$ docker inspect "opt-test" | grep "IpcMode"
            "IpcMode": "host",

What (if anything) would need to be called out in the CHANGELOG for the next release:

Add parameters Hostname,Domainname,IpcMode and PidMode to ContainerCreateOptsBuilder

vv9k commented 1 year ago

LGTM, Thank you!

D-Brox commented 1 year ago

Quick unrelated comment... I've been testing basic image/container management with both podman and balena (since they have pretty much the same API endpoints as docker implemented) and it has been working great.

vv9k commented 1 year ago

I haven't heard of balena before but looking into it seems really interesting. Cuts out the unnecessary parts of docker. As for podman it has a docker compat layer thats why it is working out of the box but if you want to use the podman specific features you might want to check out https://github.com/vv9k/podman-api-rs (shameless plug :-)