I'm trying to create a Docker image from a file on a Docker host using the Python docker API. The client is running on a different host, so I would like to avoid downloading a file to the client and then uploading it to the Docker host.
This test:
import docker
d = docker.from_env()
print(d.images.client.api.import_image("/data/file.tar", "acme.com/test"))
print(d.images.client.api.import_image("file:///data/file.tar", "acme.com/test"))
produces the following output:
{"status":"Downloading from http://%2Fdata%2Ffile.tar"}
{"errorDetail":{"message":"parse http://%2Fdata%2Ffile.tar: invalid URL escape \"%2F\""},"error":"parse http://%2Fdata%2Ffile.tar: invalid URL escape \"%2F\""}
{"status":"Downloading from file:///data/file.tar"}
{"errorDetail":{"message":"Get file:///data/file.tar: unsupported protocol scheme \"file\""},"error":"Get file:///data/file.tar: unsupported protocol scheme \"file\""}
The Docker daemon 1.13 is running on a Ubuntu 16.04 (Xenial Xerus) VM on an ESXi 6 host. The client is a Docker Python API 2.0.2 running on a physical Windows 10 host.