Installing
$ npm install docker-manifest
Usage
const const dockerManifest = ; dockerManifest;
You can also provide configuration options as a second parameter to
getImageManifest
. This allows for the use of authentication on the
registry and customization of how axios makes HTTPS requests.
Request Config
// `auth` is used to provide authentication information if required for // the registry. This is typically only for private registries and is // not required to get manifest info for public images in the Docker // Hub. auth: username: 'foo' password: 'bar' // `requestOptions` is passed directly to Axios when it makes HTTPS // requests to the registry. This can be used to set any option allowed // by Axios, but params and headers will be overwritten. Example use // for this is to allow the use of self-signed certificates by passing // a Certificate Authority to verify against. See https://github.com/axios/axios // for more info on options. requestOptions: httpsAgent: // HTTPS Agent configured to use a self-signed cert ca: ca ecdhCurve: 'auto'
Examples
Getting manifest info for the image 'library/alpine':
const dockerManifest = ; dockerManifest;
Getting manifest info from a private registry with a self-signed certificate:
const dockerManifest = ; const image = 'private-registry.com/my-image';const ca = fs; const options = auth: username: 'foo' password: 'bar' requestOptions: httpsAgent: ca: ca ecdhCurve: 'auto' // needed for node >v8.5.0 if server uses elliptic curve ; dockerManifest;