-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds bottlerocket-license-scanner's license scanning output and the repository's LICENSEs in the built container image. The clarify.toml has been added to clear up the unknown license in the sigs.k8s.io/yaml dependency. By using the scanner, the build process now relies on the bottlerocket SDK container and is downloaded automatically for builds.
- Loading branch information
Showing
6 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ dev/ | |
*.el | ||
*.tar* | ||
bin/ | ||
vendor/ |
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 +1,4 @@ | ||
/bin/ | ||
vendor/ | ||
*.tar.* | ||
*.tar |
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 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 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This Dockerfile produces an image that has only the licenses of dependencies | ||
# used in the update operator. These are collected by bottlerocket-license-scan | ||
# and organized into a project-wide conventional directory structure rooted at | ||
# /licenses in the resulting image. | ||
|
||
# SDK_IMAGE is the Bottlerocket SDK container image that provides | ||
# `bottlerocket-license-scan`. | ||
# | ||
# Generally, this will track the value of BUILDSYS_SDK_IMAGE provided in | ||
# Bottlerocket's Makefile.toml: | ||
# | ||
# https://github.com/bottlerocket-os/bottlerocket/blob/develop/Makefile.toml | ||
# | ||
# For example, see this line in Makefile.toml: | ||
# | ||
# https://github.com/bottlerocket-os/bottlerocket/blob/a1d098dcd9908e3db1dc290ed9dad53e6f8fe44c/Makefile.toml#L31 | ||
# | ||
ARG SDK_IMAGE | ||
|
||
# Fetch dependencies into a vendor/ directory. | ||
FROM golang:1.13 as src | ||
ENV GOPROXY=direct | ||
WORKDIR /src | ||
COPY go.mod go.sum /src/ | ||
RUN go mod download | ||
COPY ./ /src/ | ||
RUN go mod vendor | ||
|
||
# Run license scanner and dump result to be extracted. | ||
FROM $SDK_IMAGE as license-scan | ||
COPY --from=src /src/vendor /src/vendor | ||
COPY --from=src /src/clarify.toml /src/clarify.toml | ||
USER root | ||
RUN bottlerocket-license-scan \ | ||
--spdx-data /usr/libexec/tools/spdx-data \ | ||
--out-dir /out/licenses \ | ||
--clarify /src/clarify.toml \ | ||
go-vendor /src/vendor | ||
|
||
# Final container image has LICENSE files and accompanying attributions | ||
# collected and produced by the license scanner. | ||
FROM scratch as licenses | ||
COPY --from=license-scan /out/licenses /licenses |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[clarify."sigs.k8s.io/yaml"] | ||
# The package's files are a mix of MIT with contributions attributed to "The Go | ||
# Authors" licensed as BSD-3-Clause. | ||
expression = "MIT AND BSD-3-Clause" | ||
license-files = [ | ||
{ path = "LICENSE", hash = 0xcdf3ae00 }, | ||
] |