-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathop.yml
83 lines (80 loc) · 3.07 KB
/
op.yml
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
description: Builds an open container initiative (OCI) image
name: github.com/opspec-pkgs/opencontainers.image.build
inputs:
authConfig:
object:
default: {}
description: |
Auth config for image registries; same format as a docker config.json
Note that when using docker and a credential helper (e.g. the default with macOS docker desktop) ~/.docker/config.json will not directly contain credentials. If you need to provide auth in this case, you'll need to generate a configuration file with base64 encoded credentials. See https://github.com/docker/for-mac/issues/4100 for more discussion on the format of this file.
constraints:
properties:
auths:
type: object
description: |
Keys are registry hostname/urls and values contain authentication information
additionalProperties:
type: object
properties:
auth:
description: Base64 encoded string of the format `{username}:{password}`
type: string
format: base64
cacheDir:
dir:
default: /default_cache
description: directory used to cache images/layers across runs. Must be formatted as an [image-layout](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-layout.md)
context:
dir:
description: context for build
default: /default_context
contextIgnore:
file:
description: context ignore rules in the format of a .gitignore/.dockerignore
default: /default_context_ignore
instructions:
file:
description: build instructions in the format of a Containerfile/Dockerfile
platformsCsv:
string:
default: ''
description: |
Platforms the image will be built for in the form of comma separated [platform specifiers](https://github.com/containerd/containerd/blob/8686ededfc90076914c5238eb96c883ea093a8ba/platforms/platforms.go#L63)
e.g. 'linux/amd64,linux/arm64'
outputs:
image:
dir:
description: image in form of [v1.0.1 OCI (Open Container Initiative) `image-layout`](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-layout.md)
run:
serial:
- op:
ref: github.com/opspec-pkgs/docker.config.clean#1.1.0
inputs:
dockerConfig: $(authConfig)
outputs:
dockerConfigCleaned: $(authConfig)
- container:
cmd:
- sh
- -ce
- >
buildctl-daemonless.sh
build
--frontend dockerfile.v0
--local context=/buildContext
--local dockerfile=/
--output type=oci,tar=false,dest=/image
--import-cache type=local,src=/cacheDir
--export-cache type=local,dest=/cacheDir,mode=max
--opt platform=$(platformsCsv)
dirs:
/buildContext: $(context)
/cacheDir: $(cacheDir)
/image: $(image)
files:
/root/.docker/config.json: $(authConfig)
/Dockerfile: $(instructions)
/Dockerfile.dockerignore: $(contextIgnore)
image:
ref: moby/buildkit:master
version: 2.0.0