|
1 | 1 | steps:
|
| 2 | + - id: docker |
| 3 | + name: docker:20.10 |
| 4 | + args: |
| 5 | + - build |
| 6 | + - --target=docker |
| 7 | + - --build-arg=DOCKER_VERSION=${_DOCKER_VERSION} |
| 8 | + - --build-arg=BUILDX_DIGEST=${_BUILDX_DIGEST} |
| 9 | + - --tag=docker-buildx:cloudbuild |
| 10 | + - --file=hack/dockerfiles/buildx.dockerfile |
| 11 | + - hack/dockerfiles |
| 12 | + env: |
| 13 | + - "DOCKER_BUILDKIT=1" |
| 14 | + waitFor: ["-"] |
| 15 | + |
| 16 | + - id: protoc-builder |
| 17 | + name: docker-buildx:cloudbuild |
| 18 | + args: |
| 19 | + - buildx |
| 20 | + - build |
| 21 | + - --target=protoc-builder |
| 22 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
| 23 | + - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION} |
| 24 | + - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION} |
| 25 | + - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION} |
| 26 | + - --allow=network.host |
| 27 | + - --network=host |
| 28 | + - . |
| 29 | + waitFor: ["docker"] |
| 30 | + |
2 | 31 | - id: protoc
|
3 |
| - name: gcr.io/kaniko-project/executor:latest |
| 32 | + name: docker-buildx:cloudbuild |
4 | 33 | args:
|
5 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION} |
6 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/protoc:latest |
7 |
| - - --cache=true |
8 |
| - - --cache-repo=gcr.io/$PROJECT_ID/protoc/protoc/cache |
9 |
| - - --dockerfile=Dockerfile |
10 |
| - - --context=dir:///workspace |
11 |
| - - --reproducible |
12 |
| - - --log-timestamp |
13 |
| - - --skip-unused-stages=true |
| 34 | + - buildx |
| 35 | + - build |
14 | 36 | - --target=protoc
|
15 |
| - - --use-new-run |
| 37 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
16 | 38 | - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
|
17 | 39 | - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
|
18 | 40 | - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
|
19 |
| - waitFor: ['-'] |
| 41 | + - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION},push=false |
| 42 | + - --allow=network.host |
| 43 | + - --network=host |
| 44 | + - . |
| 45 | + waitFor: |
| 46 | + - "protoc-builder" |
20 | 47 |
|
21 | 48 | - id: protoc-debug
|
22 |
| - name: gcr.io/kaniko-project/executor:latest |
| 49 | + name: docker-buildx:cloudbuild |
23 | 50 | args:
|
24 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug |
25 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/protoc:debug |
26 |
| - - --cache=true |
27 |
| - - --cache-repo=gcr.io/$PROJECT_ID/protoc/protoc/cache |
28 |
| - - --dockerfile=Dockerfile |
29 |
| - - --context=dir:///workspace |
30 |
| - - --reproducible |
31 |
| - - --log-timestamp |
32 |
| - - --skip-unused-stages=true |
| 51 | + - buildx |
| 52 | + - build |
33 | 53 | - --target=protoc-debug
|
34 |
| - - --use-new-run |
| 54 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
| 55 | + - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION} |
| 56 | + - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION} |
| 57 | + - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION} |
| 58 | + - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug,push=false |
| 59 | + - --allow=network.host |
| 60 | + - --network=host |
| 61 | + - . |
| 62 | + waitFor: |
| 63 | + - "protoc-builder" |
| 64 | + |
| 65 | + - id: golang-builder |
| 66 | + name: docker-buildx:cloudbuild |
| 67 | + args: |
| 68 | + - buildx |
| 69 | + - build |
| 70 | + - --target=golang-builder |
| 71 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
35 | 72 | - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
|
36 | 73 | - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
|
37 | 74 | - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
|
38 |
| - waitFor: ['-'] |
| 75 | + - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION} |
| 76 | + - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION} |
| 77 | + - --allow=network.host |
| 78 | + - --network=host |
| 79 | + - . |
| 80 | + waitFor: |
| 81 | + - "protoc" |
| 82 | + - "protoc-debug" |
39 | 83 |
|
40 | 84 | - id: golang
|
41 |
| - name: gcr.io/kaniko-project/executor:latest |
| 85 | + name: docker-buildx:cloudbuild |
42 | 86 | args:
|
43 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION} |
44 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION} |
45 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:latest |
46 |
| - - --cache=true |
47 |
| - - --cache-repo=gcr.io/$PROJECT_ID/protoc/golang/cache |
48 |
| - - --dockerfile=Dockerfile |
49 |
| - - --context=dir:///workspace |
50 |
| - - --reproducible |
51 |
| - - --log-timestamp |
52 |
| - - --skip-unused-stages=true |
| 87 | + - buildx |
| 88 | + - build |
53 | 89 | - --target=golang
|
54 |
| - - --use-new-run |
| 90 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
55 | 91 | - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
|
56 | 92 | - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
|
57 | 93 | - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
|
58 | 94 | - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
|
59 | 95 | - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
|
| 96 | + - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION} |
| 97 | + - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION} |
| 98 | + - --allow=network.host |
| 99 | + - --network=host |
| 100 | + - . |
60 | 101 | waitFor:
|
61 |
| - - protoc |
| 102 | + - "golang-builder" |
62 | 103 |
|
63 | 104 | - id: golang-debug
|
64 |
| - name: gcr.io/kaniko-project/executor:latest |
| 105 | + name: docker-buildx:cloudbuild |
65 | 106 | args:
|
66 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug |
67 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug |
68 |
| - - --destination=gcr.io/$PROJECT_ID/protoc/golang:debug |
69 |
| - - --cache=true |
70 |
| - - --cache-repo=gcr.io/$PROJECT_ID/protoc/golang/cache |
71 |
| - - --dockerfile=Dockerfile |
72 |
| - - --context=dir:///workspace |
73 |
| - - --reproducible |
74 |
| - - --log-timestamp |
75 |
| - - --skip-unused-stages=true |
| 107 | + - buildx |
| 108 | + - build |
76 | 109 | - --target=golang-debug
|
77 |
| - - --use-new-run |
| 110 | + - --build-arg=BUILDKIT_INLINE_CACHE=1 |
78 | 111 | - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
|
79 | 112 | - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
|
80 | 113 | - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
|
81 | 114 | - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
|
82 | 115 | - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
|
| 116 | + - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug |
| 117 | + - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug |
| 118 | + - --allow=network.host |
| 119 | + - --network=host |
| 120 | + - . |
83 | 121 | waitFor:
|
84 |
| - - protoc-debug |
| 122 | + - "golang-builder" |
85 | 123 |
|
86 | 124 | substitutions:
|
87 |
| - _PROTOC_VERSION: "3.15.7" |
88 |
| - _GOLANG_VERSION: "1.16" |
89 |
| - _ALPINE_VERSION: "3.13" |
90 |
| - _PROTOC_GEN_GO_VERSION: "v1.26.0" |
91 |
| - _PROTOC_GEN_GO_GRPC_VERSION: "v1.1.0" |
| 125 | + _DOCKER_VERSION: "20.10" |
| 126 | + _BUILDX_DIGEST: "2ec838c5f74e1cdd5e6ea4e789c0c0f5573807550b50b2ddc6deb2c2033a286b" # https://github.com/docker/buildx/tree/084b6c0a95ce, https://github.com/docker/buildx/runs/3947339794 |
| 127 | + _PROTOC_VERSION: "3.19.0" # https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.0 |
| 128 | + _GOLANG_VERSION: "1.17" |
| 129 | + _ALPINE_VERSION: "3.14" |
| 130 | + _PROTOC_GEN_GO_VERSION: "v1.27.1" # https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.27.1 |
| 131 | + _PROTOC_GEN_GO_GRPC_VERSION: "9c668aeab869" # https://github.com/grpc/grpc-go/tree/9c668aeab869 |
| 132 | + |
| 133 | +images: |
| 134 | + - "gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}" |
| 135 | + - "gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug" |
| 136 | + - "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}" |
| 137 | + - "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}" |
| 138 | + - "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug" |
| 139 | + - "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug" |
92 | 140 |
|
93 | 141 | tags:
|
94 | 142 | - "protoc.protoc"
|
|
0 commit comments