forked from aws/amazon-ecs-agent
/
doc.go
58 lines (47 loc) · 2.17 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.
/*
Package dockerauth handles storing auth configuration information for Docker
registries.
Usage
This package pulls authentication information from the passed configuration.
A user should set the "EngineAuthType" and "EngineAuthData" configuration
keys to values indicated below.
These keys may be set by either setting the environment variables
"ECS_ENGINE_AUTH_TYPE" and "ECS_ENGINE_AUTH_DATA" or by setting the keys "EngineAuthData" and "EngineAuthType" in the JSON configuration file located at the configured "ECS_AGENT_CONFIG_FILE_PATH" (see http://godoc.org/github.com/aws/amazon-ecs-agent/agent/config)
Auth Types
The two currently supported auth types are "docker" and "dockercfg".
Docker:
The auth type "docker" is intended to work most naturally with a JSON
configuration file. The "AuthData" is a structured JSON object which specifies
values for the docker "AuthConfig" structure. The "AuthData" should be an object
similar to the following:
{
"my.registry.example.com": {
"username": "myUsername",
"password": "myPassword"
},
"https://index.docker.io/v1/user": {
"username": "my-dockerhub-username",
"password": "my-dockerhub-password",
"email": "my-optinallyincluded-email"
}
}
Dockercfg:
The auth type "dockercfg" is intended to allow easy use of an existing
".dockercfg" file generated by running "docker login". This auth type expects
the "AuthData" to be a string containing the contents of that file. The contents
of your ".dockercfg" will generally be a string of the following form:
'{"http://myregistry.com/v1/":{"auth":"dXNlcjpzd29yZGZpc2g=","email":"email"}'
*/
package dockerauth