-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbdbf02
commit e0ce045
Showing
6 changed files
with
89 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
FROM golang:1.19-alpine{{ .alpine }} AS build | ||
|
||
RUN apk add --no-cache git make | ||
|
||
ENV NOTARYPKG github.com/theupdateframework/notary | ||
ENV TAG v{{ .version }} | ||
|
||
ENV GOFLAGS -mod=vendor | ||
|
||
WORKDIR /go/src/$NOTARYPKG | ||
RUN set -eux; \ | ||
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \ | ||
# In case the version in file doens't match the tag (like in 0.7.0) | ||
echo "${TAG//v/}" > NOTARY_VERSION; \ | ||
# https://github.com/notaryproject/notary/pull/1635 | ||
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \ | ||
git -c user.name=foo -c [email protected] cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \ | ||
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576) | ||
go get github.com/dvsekhvalnov/[email protected]; \ | ||
go mod vendor; \ | ||
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576) | ||
# Make the version detectable by scanners | ||
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \ | ||
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \ | ||
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \ | ||
/notary-server --version; \ | ||
/notary-signer --version; | ||
|
||
FROM alpine:{{ .alpine }} | ||
|
||
RUN adduser -D -H -g "" notary | ||
|
@@ -12,7 +40,7 @@ ENV INSTALLDIR /notary/{{ env.variant }} | |
ENV PATH=$PATH:${INSTALLDIR} | ||
WORKDIR ${INSTALLDIR} | ||
|
||
COPY --from=notary:{{ .version }}-builder /notary-{{ env.variant }} ./ | ||
COPY --from=build /notary-{{ env.variant }} ./ | ||
RUN ./notary-{{ env.variant }} --version | ||
|
||
COPY ./{{ env.variant }}-config.json . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,34 @@ | |
# PLEASE DO NOT EDIT IT DIRECTLY. | ||
# | ||
|
||
FROM golang:1.19-alpine3.16 AS build | ||
|
||
RUN apk add --no-cache git make | ||
|
||
ENV NOTARYPKG github.com/theupdateframework/notary | ||
ENV TAG v0.7.0 | ||
|
||
ENV GOFLAGS -mod=vendor | ||
|
||
WORKDIR /go/src/$NOTARYPKG | ||
RUN set -eux; \ | ||
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \ | ||
# In case the version in file doens't match the tag (like in 0.7.0) | ||
echo "${TAG//v/}" > NOTARY_VERSION; \ | ||
# https://github.com/notaryproject/notary/pull/1635 | ||
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \ | ||
git -c user.name=foo -c [email protected] cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \ | ||
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576) | ||
go get github.com/dvsekhvalnov/[email protected]; \ | ||
go mod vendor; \ | ||
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576) | ||
# Make the version detectable by scanners | ||
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \ | ||
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \ | ||
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \ | ||
/notary-server --version; \ | ||
/notary-signer --version; | ||
|
||
FROM alpine:3.16 | ||
|
||
RUN adduser -D -H -g "" notary | ||
|
@@ -13,7 +41,7 @@ ENV INSTALLDIR /notary/server | |
ENV PATH=$PATH:${INSTALLDIR} | ||
WORKDIR ${INSTALLDIR} | ||
|
||
COPY --from=notary:0.7.0-builder /notary-server ./ | ||
COPY --from=build /notary-server ./ | ||
RUN ./notary-server --version | ||
|
||
COPY ./server-config.json . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,34 @@ | |
# PLEASE DO NOT EDIT IT DIRECTLY. | ||
# | ||
|
||
FROM golang:1.19-alpine3.16 AS build | ||
|
||
RUN apk add --no-cache git make | ||
|
||
ENV NOTARYPKG github.com/theupdateframework/notary | ||
ENV TAG v0.7.0 | ||
|
||
ENV GOFLAGS -mod=vendor | ||
|
||
WORKDIR /go/src/$NOTARYPKG | ||
RUN set -eux; \ | ||
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \ | ||
# In case the version in file doens't match the tag (like in 0.7.0) | ||
echo "${TAG//v/}" > NOTARY_VERSION; \ | ||
# https://github.com/notaryproject/notary/pull/1635 | ||
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \ | ||
git -c user.name=foo -c [email protected] cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \ | ||
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576) | ||
go get github.com/dvsekhvalnov/[email protected]; \ | ||
go mod vendor; \ | ||
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576) | ||
# Make the version detectable by scanners | ||
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \ | ||
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \ | ||
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \ | ||
/notary-server --version; \ | ||
/notary-signer --version; | ||
|
||
FROM alpine:3.16 | ||
|
||
RUN adduser -D -H -g "" notary | ||
|
@@ -14,7 +42,7 @@ ENV INSTALLDIR /notary/signer | |
ENV PATH=$PATH:${INSTALLDIR} | ||
WORKDIR ${INSTALLDIR} | ||
|
||
COPY --from=notary:0.7.0-builder /notary-signer ./ | ||
COPY --from=build /notary-signer ./ | ||
RUN ./notary-signer --version | ||
|
||
COPY ./signer-config.json . | ||
|