Skip to content

Commit 3400587

Browse files
authored
Merge pull request kubernetes-sigs#134 from MrHohn/build-template-update
Update go-build-template scaffold to the latest.
2 parents 20c1f16 + b809c2f commit 3400587

File tree

9 files changed

+2044
-144
lines changed

9 files changed

+2044
-144
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/.push-*
44
/.container-*
55
/.dockerfile-*
6-
/.idea/
6+
/.licenses*
7+
/.buildx-initialized

Dockerfile.in

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,26 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM gcr.io/distroless/static:nonroot
15+
FROM {ARG_FROM}
1616

17-
MAINTAINER Zihong Zheng <[email protected]>
17+
# When building, we can pass a unique value (e.g. `date +%s`) for this arg,
18+
# which will force a rebuild from here (by invalidating docker's cache).
19+
ARG FORCE_REBUILD=0
1820

19-
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
21+
# When building, we can pass a hash of the licenses tree, which docker checks
22+
# against its cache and can force a rebuild from here.
23+
ARG HASH_LICENSES=0
2024

21-
ENTRYPOINT ["/ARG_BIN"]
25+
# Add third-party licenses.
26+
COPY .licenses/ /LICENSES/
27+
28+
# When building, we can pass a hash of the binary, which docker checks against
29+
# its cache and can force a rebuild from here.
30+
ARG HASH_BINARY=0
31+
32+
# Add the platform-specific binary.
33+
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
34+
35+
ENV HOME /
36+
37+
ENTRYPOINT ["/{ARG_BIN}"]

0 commit comments

Comments
 (0)