A recent commit introduced support for defining host-bound volumes (e796c76). A design issue around the overloaded use of the BoundHostVolumes type has led to hacky and incomplete support for inspecting containers that contain volumes.
For background, running a Docker container involves two API calls, createContainer(ContainerConfig) and startContainer(HostConfig). Bound host volumes are partially defined in ContainerConfig and partially defined in HostConfig. Commit e796c76 strives to use a single type - BoundHostVolumes - as the property type within both ContainerConfig and HostConfig. The solution is non-functional - inspectContainer is broken and incomplete.
I propose we:
- introduce new inner types ContainerConfig.Volumes and HostConfig.Binds that serialize/deserialize naturally.
- re-imagine BoundHostVolumes as a 'builder' type that generates Volumes and Binds objects.
- deprecate ContainerConfig#getVolumes and introduce a new property, getVolumes2 that returns an instance of Volumes. This is to avoid a breaking change.
- deprecate HostConfig.getBinds and introduce a new property, getBinds2 that returns an instance of Binds. This is to avoid a breaking change.
A recent commit introduced support for defining host-bound volumes (e796c76). A design issue around the overloaded use of the BoundHostVolumes type has led to hacky and incomplete support for inspecting containers that contain volumes.
For background, running a Docker container involves two API calls, createContainer(ContainerConfig) and startContainer(HostConfig). Bound host volumes are partially defined in ContainerConfig and partially defined in HostConfig. Commit e796c76 strives to use a single type - BoundHostVolumes - as the property type within both ContainerConfig and HostConfig. The solution is non-functional - inspectContainer is broken and incomplete.
I propose we: