
If you use the following URL in your REST client, you will get the JSON output in a prettified manner as shown in the image below. You can test the API using REST client like Postman. You Might Like: Docker Useful Hacks Test using a REST client The above command will output all the images in your docker host in JSON format. Note: replace the IP with your Docker host IP or localhost as shown below. Get the IP address of your Docker host where you enabled remote API and execute the following command from any terminal which supports curl. You can use curl command-line utility or REST APIs to access the Docker API. Now, remote API is enabled on your docker host. Execute the following commands to do that.

Now for all the changes to take place, you need to restart the daemon and Docker service. Note: Also, please add necessary firewall rules for your server to accept connection on port 4243 “0.0.0.0” means docker-engine accepts connections from all IP addresses. The above command will bind the docker engine server to the Unix socket as well as TCP port 4243. Open the file /lib/systemd/system/rvice, search for ExecStart and add value as shown below. In that file, there is an ExecStart parameter.

For this, you can use the remote API feature. One more use case is that let’s say you have an application and you want to get the details of the containers in docker host. For this scenario, you can use the remote API and connect to it using the REST API’s as the docker engine accepts REST requests. Let’s say you are running the docker host on a remote server and you want to connect to it from your laptop. The primary use of a Docker remote API is to connect with the Docker engine remotely.
Docker tcp api how to#
In this post, you will learn how to expose Docker engines API for remote docker command execution through REST APIs What is Docker remote API?
