File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1
2+
3+ FROM alpine:edge AS gen
4+ RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
5+ RUN apk --update --no-cache add mkcert@testing ca-certificates
6+ WORKDIR /certs
7+ RUN mkdir -p daemon client
8+ ARG SAN=localhost
9+ ARG SAN_CLIENT=client
10+ RUN echo $SAN | tr " " "\n " >SAN
11+ RUN CAROOT=$(pwd) mkcert -cert-file daemon/cert.pem -key-file daemon/key.pem $SAN
12+ RUN CAROOT=$(pwd) mkcert -client -cert-file client/cert.pem -key-file client/key.pem $SAN_CLIENT
13+ RUN cp -f rootCA.pem daemon/ca.pem
14+ RUN cp -f rootCA.pem client/ca.pem
15+ RUN rm -f rootCA.pem rootCA-key.pem
16+
17+ FROM scratch
18+ COPY --from=gen /certs /
Original file line number Diff line number Diff line change 1+ # Create BuildKit certificates
2+
3+ This [ bake definition] ( docker-bake.hcl ) can be used for creating certificates:
4+
5+ ``` bash
6+ SAN=" 127.0.0.1" docker buildx bake https://github.com/moby/buildkit.git#master:examples/create-certs
7+ ```
Original file line number Diff line number Diff line change 1+ variable "SAN" {
2+ default = " 127.0.0.1"
3+ }
4+
5+ group "default" {
6+ targets = [" certs" ]
7+ }
8+
9+ target "certs" {
10+ args = {
11+ SAN = SAN
12+ }
13+ output = [" ./.certs" ]
14+ }
You can’t perform that action at this time.
0 commit comments