Finally, you can create the image through the Docker API .
Example Docker File:
Create a tar file that includes your Docker file.
# tar -cvf Dockerfile.tar.gz Dockerfile
Run the API as shown below and for more options, refer to this.
# curl -v -X POST -H "Content-Type:application/tar" --data-binary '@Dockerfile.tar.gz' http://127.0.0.1:5000/build?t=build_test * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 5000 (
Check docker images after successfully creating the image.
We removed the part of the output that is not needed.
To configure docker daemon port , refer to this
source share