A REST API is an HTTP interface that exposes resources and operations according to representational state transfer. It gives clients a standard way to request information or perform actions without requiring the client and service to share an implementation. section 2.5
Docker uses this pattern to separate its command-line client from the Docker Engine. The CLI sends HTTP requests to the Engine API, which manages containers, images, networks, and other resources. The same API can be reached locally or from another computer when configured and secured for remote access. section 2.5
A REST API becomes practical when you can identify the service, resource, and request workflow:
- Use the documented API endpoint rather than assuming the command-line client is the only interface. section 5.6
- Inspect the resource you need, such as image tags or a manifest, before attempting an operation. section 5.6
- Follow API-specific requirements, including request headers needed for operations such as deleting an image. section 5.6
A containerized REST API
A Java web application exposes a REST API that fetches NASA's Astronomy Picture of the Day, caches the result locally, and returns the picture details as JSON. Build the image, run it with Docker, and browse to http://localhost:800/image to verify the response. section 4.2





















