I want to write a script which going to use docker API. It will communicate with the docker engine which runs on the host machine.
I don’t wanna install the entire docker to my image just CLI and later use the host network to communicate with the docker engine.
My script under the hood gonna run commands like docker image inspect someiamge
2
Answers
I thinking about using docker image to extract the CLI client.
Example of dockerfile
And later you could use this image with following command
This has a significant downside. The docker image does not support
linux/arm/v7
architecture.Better to use SDK.
You can use binary distribution of docker, which can be downloaded from here, you can get docker client binaries there.
Here is the documentation of installation of a docker from binaries. Just skip part of starting docker engine and make sure that your docker client points to a correct remote engine (mounting /var/run/docker.sock)