Macaroons are authorization credentials for distributed systems. This proposal won't try to explain what macaroons are, there are very good resources online, so it will focus on how to used them to implement and authorization system for Docker's remote API.
The first command to run is docker id --init
. This will create the root macaroon in the server and it will be shared with the client.
$ docker id --init --secret "Super secret token"