https://github.com/bmonty/docker-manifest
Node module to get info on docker images from repositories.
https://github.com/bmonty/docker-manifest
docker javascript
Last synced: 3 months ago
JSON representation
Node module to get info on docker images from repositories.
- Host: GitHub
- URL: https://github.com/bmonty/docker-manifest
- Owner: bmonty
- License: mit
- Created: 2017-09-27T08:59:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T22:05:42.000Z (over 3 years ago)
- Last Synced: 2025-03-04T10:34:00.370Z (3 months ago)
- Topics: docker, javascript
- Language: JavaScript
- Size: 146 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installing
```bash
$ npm install docker-manifest
```## Usage
```js
const dockerManifest = require('docker-manifest');dockerManifest.getImageManifest('library/alpine').then((manifest) => {
console.log(manifest);
});
```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
```js
{
// `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: new https.Agent({ // HTTPS Agent configured to use a self-signed cert
ca: [ca],
ecdhCurve: 'auto',
}),
}
}
```## Examples
Getting manifest info for the image 'library/alpine':
```js
const dockerManifest = require('docker-manifest');dockerManifest.getImageManifest('library/alpine').then((manifest) => {
console.log(manifest);
});
```Getting manifest info from a private registry with a self-signed certificate:
```js
const dockerManifest = require('docker-manifest');const image = 'private-registry.com/my-image';
const ca = fs.readFileSync('ca.pem');const options = {
auth: {
username: 'foo',
password: 'bar',
},
requestOptions: {
httpsAgent: new https.Agent({
ca: [ca],
ecdhCurve: 'auto', // needed for node >v8.5.0 if server uses elliptic curve
}),
},
};dockerManifest.getImageManifest(image, options).then((manifest) => {
console.log(manifest);
});
```