/
DockerImage.ts
68 lines (63 loc) · 1.46 KB
/
DockerImage.ts
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
59
60
61
62
63
64
65
66
67
68
import { EnvironmentParameter } from '../../Parameters/types';
export class DockerImage implements DockerImageShape {
image: string;
name?: string;
entrypoint?: string[];
command?: string[];
user?: string;
auth?: DockerAuth;
environment?: EnvironmentParameter;
aws_auth?: DockerAuthAWS;
constructor(
image: string,
name?: string,
entrypoint?: string[],
command?: string[],
user?: string,
environment?: EnvironmentParameter,
auth?: DockerAuth,
aws_auth?: DockerAuthAWS,
) {
this.image = image;
this.name = name;
this.entrypoint = entrypoint;
this.command = command;
this.user = user;
this.environment = environment;
this.auth = auth;
this.aws_auth = aws_auth;
}
}
/**
* Type interface for a single Docker image.
*/
export type DockerImageShape = {
name?: string;
image: string;
entrypoint?: string[];
command?: string[];
user?: string;
auth?: DockerAuth;
environment?: EnvironmentParameter;
aws_auth?: DockerAuthAWS;
};
/**
* Authentication for registries using standard `docker login` credentials
*/
export type DockerAuth = {
username: string;
/**
* Specify an environment variable (e.g. $DOCKER_PASSWORD)
*/
password: string;
};
/**
* Authentication for AWS Elastic Container Registry (ECR)
*/
export type DockerAuthAWS = {
aws_access_key_id: string;
/**
* Specify an environment variable (e.g. $ECR_AWS_SECRET_ACCESS_KEY)
*/
aws_secret_access_key: string;
};