mirror of https://github.com/docker/cli.git
bake target to generate certs for e2e tets
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit d234a81de7
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6a8406e602
commit
80f27987f4
|
@ -159,3 +159,9 @@ target "e2e-image" {
|
||||||
VERSION = VERSION
|
VERSION = VERSION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target "e2e-gencerts" {
|
||||||
|
inherits = ["_common"]
|
||||||
|
dockerfile = "./e2e/testdata/Dockerfile.gencerts"
|
||||||
|
output = ["./e2e/testdata"]
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
ARG GO_VERSION=1.19.7
|
||||||
|
|
||||||
|
FROM golang:${GO_VERSION}-alpine AS generated
|
||||||
|
RUN go install github.com/dmcgowan/quicktls@master
|
||||||
|
WORKDIR /tmp/gencerts/notary
|
||||||
|
RUN --mount=type=bind,source=e2e/testdata/notary,target=/tmp/gencerts/notary,rw <<EOT
|
||||||
|
set -eu
|
||||||
|
mkdir -p ../notary-evil /out
|
||||||
|
quicktls -org=Docker -with-san notary-server notaryserver evil-notary-server evilnotaryserver localhost 127.0.0.1
|
||||||
|
cat ca.pem >> notary-server.cert
|
||||||
|
mv ca.pem root-ca.cert
|
||||||
|
cp notary-server.cert notary-server.key root-ca.cert ../notary-evil
|
||||||
|
cp -r /tmp/gencerts/notary* /out/
|
||||||
|
EOT
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=generated /out /
|
|
@ -1,12 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# This script is used to generate the test-certificates in the notary-server and
|
|
||||||
# evil-notary-server directories. Run this script to update the certificates if
|
|
||||||
# they expire.
|
|
||||||
GO111MODULE=off go get -u github.com/dmcgowan/quicktls
|
|
||||||
cd notary
|
|
||||||
quicktls -org=Docker -with-san notary-server notaryserver evil-notary-server evilnotaryserver localhost 127.0.0.1
|
|
||||||
cat ca.pem >> notary-server.cert
|
|
||||||
mv ca.pem root-ca.cert
|
|
||||||
cp notary-server.cert notary-server.key root-ca.cert ../notary-evil/
|
|
Loading…
Reference in New Issue