Skip to content

Commit cf64d96

Browse files
Removed the builder variant
1 parent dbdbf02 commit cf64d96

File tree

7 files changed

+89
-75
lines changed

7 files changed

+89
-75
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
13-
- run: |
14-
docker build notary-builder --tag notary:builder
15-
tag="$(docker run --rm notary:builder sh -c 'echo $TAG' | awk '{gsub(/^v/, ""); print}')"
16-
docker tag notary:builder "notary:${tag}-builder"
1713
- run: docker build notary-server --tag notary:server
1814
- run: docker build notary-signer --tag notary:signer
1915
- uses: actions/checkout@v3 # clone Notary upstream repo (used for generating necessary certificates to test against)

Dockerfile-builder.template

Lines changed: 0 additions & 27 deletions
This file was deleted.

Dockerfile.template

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
FROM golang:1.19-alpine{{ .alpine }} AS build
2+
3+
RUN apk add --no-cache git make
4+
5+
ENV NOTARYPKG github.com/theupdateframework/notary
6+
ENV TAG v{{ .version }}
7+
8+
ENV GOFLAGS -mod=vendor
9+
10+
WORKDIR /go/src/$NOTARYPKG
11+
RUN set -eux; \
12+
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \
13+
# In case the version in file doens't match the tag (like in 0.7.0)
14+
echo "${TAG//v/}" > NOTARY_VERSION; \
15+
# https://github.com/notaryproject/notary/pull/1635
16+
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \
17+
git -c user.name=foo -c user.email=foo@example.com cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \
18+
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576)
19+
go get github.com/dvsekhvalnov/jose2go@v0.0.0-20200901110807-248326c1351b; \
20+
go mod vendor; \
21+
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576)
22+
# Make the version detectable by scanners
23+
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \
24+
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \
25+
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \
26+
/notary-server --version; \
27+
/notary-signer --version;
28+
129
FROM alpine:{{ .alpine }}
230

331
RUN adduser -D -H -g "" notary
@@ -12,7 +40,7 @@ ENV INSTALLDIR /notary/{{ env.variant }}
1240
ENV PATH=$PATH:${INSTALLDIR}
1341
WORKDIR ${INSTALLDIR}
1442

15-
COPY --from=notary:{{ .version }}-builder /notary-{{ env.variant }} ./
43+
COPY --from=build /notary-{{ env.variant }} ./
1644
RUN ./notary-{{ env.variant }} --version
1745

1846
COPY ./{{ env.variant }}-config.json .

apply-templates.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@ generated_warning() {
2626

2727
export version=latest
2828

29-
for variant in builder signer server; do
29+
for variant in signer server; do
3030
export variant
3131

3232
dockerfile=
3333
dest="notary-$variant/Dockerfile"
3434

3535
rm "$dest"
3636

37-
case "$variant" in
38-
builder)
39-
dockerfile="Dockerfile-$variant.template"
40-
;;
41-
*)
42-
dockerfile="Dockerfile.template"
43-
esac
37+
dockerfile="Dockerfile.template"
4438

4539
{
4640
generated_warning

notary-builder/Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

notary-server/Dockerfile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44
# PLEASE DO NOT EDIT IT DIRECTLY.
55
#
66

7+
FROM golang:1.19-alpine3.16 AS build
8+
9+
RUN apk add --no-cache git make
10+
11+
ENV NOTARYPKG github.com/theupdateframework/notary
12+
ENV TAG v0.7.0
13+
14+
ENV GOFLAGS -mod=vendor
15+
16+
WORKDIR /go/src/$NOTARYPKG
17+
RUN set -eux; \
18+
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \
19+
# In case the version in file doens't match the tag (like in 0.7.0)
20+
echo "${TAG//v/}" > NOTARY_VERSION; \
21+
# https://github.com/notaryproject/notary/pull/1635
22+
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \
23+
git -c user.name=foo -c user.email=foo@example.com cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \
24+
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576)
25+
go get github.com/dvsekhvalnov/jose2go@v0.0.0-20200901110807-248326c1351b; \
26+
go mod vendor; \
27+
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576)
28+
# Make the version detectable by scanners
29+
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \
30+
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \
31+
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \
32+
/notary-server --version; \
33+
/notary-signer --version;
34+
735
FROM alpine:3.16
836

937
RUN adduser -D -H -g "" notary
@@ -13,7 +41,7 @@ ENV INSTALLDIR /notary/server
1341
ENV PATH=$PATH:${INSTALLDIR}
1442
WORKDIR ${INSTALLDIR}
1543

16-
COPY --from=notary:0.7.0-builder /notary-server ./
44+
COPY --from=build /notary-server ./
1745
RUN ./notary-server --version
1846

1947
COPY ./server-config.json .

notary-signer/Dockerfile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44
# PLEASE DO NOT EDIT IT DIRECTLY.
55
#
66

7+
FROM golang:1.19-alpine3.16 AS build
8+
9+
RUN apk add --no-cache git make
10+
11+
ENV NOTARYPKG github.com/theupdateframework/notary
12+
ENV TAG v0.7.0
13+
14+
ENV GOFLAGS -mod=vendor
15+
16+
WORKDIR /go/src/$NOTARYPKG
17+
RUN set -eux; \
18+
git clone -b "$TAG" --depth 1 "https://$NOTARYPKG.git" .; \
19+
# In case the version in file doens't match the tag (like in 0.7.0)
20+
echo "${TAG//v/}" > NOTARY_VERSION; \
21+
# https://github.com/notaryproject/notary/pull/1635
22+
git fetch --depth 2 origin efc35b02698644af16f6049c7b585697352451b8; \
23+
git -c user.name=foo -c user.email=foo@example.com cherry-pick -x efc35b02698644af16f6049c7b585697352451b8; \
24+
# https://github.com/notaryproject/notary/issues/1602 (rough cherry-pick of ca095023296d2d710ad9c6dec019397d46bf8576)
25+
go get github.com/dvsekhvalnov/jose2go@v0.0.0-20200901110807-248326c1351b; \
26+
go mod vendor; \
27+
# TODO remove for the next release of Notary (which should include efc35b02698644af16f6049c7b585697352451b8 & ca095023296d2d710ad9c6dec019397d46bf8576)
28+
# Make the version detectable by scanners
29+
sed -i -r -E 's|(version.NotaryVersion=\$\(NOTARY_VERSION\))|\1 -X $(NOTARY_PKG)/version.Version=$(NOTARY_VERSION)|' Makefile; \
30+
make SKIPENVCHECK=1 PREFIX=. ./bin/static/notary-server ./bin/static/notary-signer; \
31+
cp -vL ./bin/static/notary-server ./bin/static/notary-signer /; \
32+
/notary-server --version; \
33+
/notary-signer --version;
34+
735
FROM alpine:3.16
836

937
RUN adduser -D -H -g "" notary
@@ -14,7 +42,7 @@ ENV INSTALLDIR /notary/signer
1442
ENV PATH=$PATH:${INSTALLDIR}
1543
WORKDIR ${INSTALLDIR}
1644

17-
COPY --from=notary:0.7.0-builder /notary-signer ./
45+
COPY --from=build /notary-signer ./
1846
RUN ./notary-signer --version
1947

2048
COPY ./signer-config.json .

0 commit comments

Comments
 (0)