X Tutup
Skip to content

Volumes can not be bound when creating a container #164

@nesneros

Description

@nesneros

It is not possible to bind a volume when a container is create. On the command line you can do something like

docker create -v /host/path:/container/path image

AFAIKS that is not possible with docker-java. Instead you have to start a container if you want to bind a volume. That is very inconvenient if you for example use Data Only Containers.

If you take a look at the documentation of the Docker rest api, there is a change from 1.15 to 1.16 that the container start api doesn't take any configurations arguments in v1.16. It is all in the create api. 1.15 vs. 1.16.

In the docker-java api the create command has a method withVolumes(Volume... volumes) and the start command has a method withBinds(Bind... binds). Is there a good reason for the differences? As I see it the withBinds method is the general one and should also be on the create command.

/Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup