https://github.com/dweinstein/dockerode-authconfig
Normalize auth info from ~/.docker/config.json to the authConfig format for the docker daemon.
https://github.com/dweinstein/dockerode-authconfig
Last synced: about 2 months ago
JSON representation
Normalize auth info from ~/.docker/config.json to the authConfig format for the docker daemon.
- Host: GitHub
- URL: https://github.com/dweinstein/dockerode-authconfig
- Owner: dweinstein
- License: mit
- Created: 2016-03-21T00:57:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-11T21:48:56.000Z (about 9 years ago)
- Last Synced: 2025-02-12T07:01:45.216Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
Normalize auth info from `~/.docker/config.json` to the [`authConfig`
format](https://docs.docker.com/engine/reference/api/docker_remote_api/#authentication)
for the docker daemon.# USAGE
Install: `npm i dockerode-authconfig`
```js
var assert = require('assert');
var normalize = require('.');
var orig = {
auths: {
'foo.bar.baz': {
email: '[email protected]',
auth: 'QGZvbzpzdXBlcmR1cGVyZG8='
},
'already.ready': {
username: '@ok',
password: 'okyouwin'
}
}
};
var res = normalize(orig);
assert.deepEqual(res, {
auths: {
'foo.bar.baz': {
username: '@foo',
password: 'superduperdo'
},
'already.ready': {
username: '@ok',
password: 'okyouwin'
}
}
});
console.log('----orig----');
console.log(orig);
console.log('----norm----');
console.log(res);
```