-
Notifications
You must be signed in to change notification settings - Fork 1
/
api-calls.http
143 lines (120 loc) · 5.99 KB
/
api-calls.http
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
### GENERIC request
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"string\", \"source_url\": \"string\", \"source_username\": \"string\", \"source_password\": \"string\", \"build_context\": { \"dir_name\": \"string\", \"subdir\": \"string\", \"url\": \"string\", \"username\": \"string\", \"password\": \"string\" }, \"target_image_name\": \"string\", \"target_image_tag\": \"string\", \"target_images\": [ { \"image\": \"string\", \"tag\": \"string\", \"base\": \"string\" } ]}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "string",
"source_url": "string",
"source_username": "string",
"source_password": "string",
"build_context": {
"dir_name": "string",
"subdir": "string",
"url": "string",
"username": "string",
"password": "string"
},
"target_image_name": "string",
"target_image_tag": "string",
"target_images": [
{
"image": "string",
"tag": "string",
"base": "string"
}
]
}
###
# 1. Build from TAR
###
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"tar\", \"source_url\": \"https://github.com/mihaTrajbaric/image-builder-test-files/blob/master/hello-world.tar?raw=true\", \"target_image_name\": \"tests/tar\", \"target_image_tag\": \"latest\"}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "tar",
"source_url": "https://github.com/mihaTrajbaric/image-builder-test-files/blob/master/hello-world.tar?raw=true",
"target_image_name": "tests/tar",
"target_image_tag": "latest"
}
###
# 2. Build from Dockerfile, no build context
###
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"dockerfile\", \"source_url\": \"https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/no_context/Dockerfile\", \"target_image_name\": \"tests/no_context\", \"target_image_tag\": \"latest\"}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "dockerfile",
"source_url": "https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/no_context/Dockerfile",
"target_image_name": "tests/no_context",
"target_image_tag": "latest"
}
###
# 3. Build from Dockerfile, with build context
###
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"dockerfile\", \"source_url\": \"https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/python_build_context/Dockerfile\", \"build_context\": { \"dir_name\": \"build_context\", \"url\": \"https://github.com/mihaTrajbaric/generic_docker_build_context.git\" }, \"target_image_name\": \"tests/build-context\", \"target_image_tag\": \"latest\"}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "dockerfile",
"source_url": "https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/python_build_context/Dockerfile",
"build_context": {
"dir_name": "build_context",
"url": "https://github.com/mihaTrajbaric/generic_docker_build_context.git"
},
"target_image_name": "tests/build-context",
"target_image_tag": "latest"
}
###
# 4. Build from Dockerfile, with build context, multiple image variants
###
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"dockerfile\", \"source_url\": \"https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/image-variants/Dockerfile\", \"build_context\": { \"dir_name\": \"generic_build_context\", \"url\": \"https://github.com/mihaTrajbaric/generic_docker_build_context.git\" }, \"target_images\": [ { \"image\": \"tests/image_variants\", \"tag\": \"latest\" }, { \"image\": \"tests/image_variants\", \"tag\": \"python-3.8\", \"base\": \"python:3.8-alpine\" } ]}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "dockerfile",
"source_url": "https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/image-variants/Dockerfile",
"build_context": {
"dir_name": "generic_build_context",
"url": "https://github.com/mihaTrajbaric/generic_docker_build_context.git"
},
"target_images": [
{
"image": "tests/image_variants",
"tag": "latest"
},
{
"image": "tests/image_variants",
"tag": "python-3.8",
"base": "python:3.8-alpine"
}
]
}
###
# 5. Build from Dockerfile, with build context in subdir 'no_context'
###
# curl -X POST "http://localhost:8080/build/" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"source_type\": \"dockerfile\", \"source_url\": \"https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/no_context/Dockerfile\", \"build_context\": { \"dir_name\": \"image-builder-test-files\", \"subdir\": \"no_context\", \"url\": \"https://github.com/mihaTrajbaric/image-builder-test-files\" }, \"target_image_name\": \"tests/subdir_context\", \"target_image_tag\": \"latest\"}"
POST http://localhost:8080/build/
accept: application/json
Content-Type: application/json
{
"source_type": "dockerfile",
"source_url": "https://raw.githubusercontent.com/mihaTrajbaric/image-builder-test-files/master/no_context/Dockerfile",
"build_context": {
"dir_name": "image-builder-test-files",
"subdir": "no_context",
"url": "https://github.com/mihaTrajbaric/image-builder-test-files"
},
"target_image_name": "tests/subdir_context",
"target_image_tag": "latest"
}
###
# STATUS
###
# curl -X GET "http://localhost:8080/status/session_token" -H "accept: application/json"
GET http://localhost:8080/status/[session_token]
accept: application/json