Skip to content

Commit 2bffc7c

Browse files
authored
Merge pull request #311 from jetstack/license
feat: Adding licensing information to image
2 parents e661b9c + 95e65b4 commit 2bffc7c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gcr.io/distroless/static
1+
FROM gcr.io/distroless/static as release
22

33
# TARGETPLATFORM comes from the buildx context and it will be something like `linux/arm64/v8` or `linux/amd64`.
44
# Ref: https://docs.docker.com/buildx/working-with-buildx/
@@ -7,6 +7,10 @@ ARG TARGETPLATFORM
77
USER 1000:1000
88

99
COPY ./builds/${TARGETPLATFORM}/preflight /bin/preflight
10+
11+
# '/usr/share/doc/$PACKAGE' is a pretty standard location for notices. In particular Debian does it this way.
12+
COPY ./builds/licenses /usr/share/doc/preflight/
13+
1014
# load in an example config file
1115
ADD ./agent.yaml /etc/preflight/agent.yaml
1216
ENTRYPOINT ["preflight"]

builder.dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ RUN make build-all-platforms \
2121
OAUTH_CLIENT_ID=${oauth_client_id} \
2222
OAUTH_CLIENT_SECRET=${oauth_client_secret} \
2323
OAUTH_AUTH_SERVER_DOMAIN=${oauth_auth_server_domain}
24+
25+
26+
# c781b427440f8ea100841eefdd308e660d26d121 is the v1.0.0 tag at the time of writing.
27+
RUN go install github.com/google/go-licenses@c781b427440f8ea100841eefdd308e660d26d121
28+
29+
# We need this '|| true' because go-licenses could fail to find a license so
30+
# may return a non-zero exit code and there's no way to supress it.
31+
RUN /go/bin/go-licenses save ./ --save_path="./builds/licenses/" || true

0 commit comments

Comments
 (0)