In the previous recipe, we explored a few actions on Docker images using APIs. In this recipe, we will build a Docker image using the /build API. Here is the /build API snippet from Swagger Editor:
![](https://static.packt-cdn.com/products/9781788626866/graphics/assets/bcf39d39-3336-420b-92a9-576325a24fa1.png)
In the previous recipe, we explored a few actions on Docker images using APIs. In this recipe, we will build a Docker image using the /build API. Here is the /build API snippet from Swagger Editor:
$ git clone https://github.com/docker-cookbook/apache2
This repository contains the Dockerfile to bundle an apache2 service; listed here is the content of the Dockerfile:
$ cd apache2 $ tar cvf /tmp/apache2.tar *