-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Append -static-libgcc on Linux (#215)
* Append -static-libgcc on Linux Signed-off-by: Dhi Aurrahman <[email protected]> * Test on CI Signed-off-by: Dhi Aurrahman <[email protected]> * Newline Signed-off-by: Dhi Aurrahman <[email protected]> * Add ref Signed-off-by: Dhi Aurrahman <[email protected]> * Add comment Signed-off-by: Dhi Aurrahman <[email protected]> * Fix Signed-off-by: Dhi Aurrahman <[email protected]> * Update to use gcr.io/distroless/cc-debian11 Signed-off-by: Dhi Aurrahman <[email protected]>
- Loading branch information
Showing
6 changed files
with
71 additions
and
8 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
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# Copyright Istio Authors | ||
# Licensed under the Apache License, Version 2.0 (the "License") | ||
|
||
FROM gcr.io/distroless/cc:nonroot | ||
FROM gcr.io/distroless/cc-debian11:nonroot | ||
|
||
COPY ./build_release/auth_server /app/auth_server | ||
USER nonroot:nonroot | ||
# We can't use nonroot:nonroot here since in K8s: | ||
# https://github.com/kubernetes/kubernetes/blob/98eff192802a87c613091223f774a6c789543e74/pkg/kubelet/kuberuntime/security_context_others.go#L49. | ||
USER 65532:65532 | ||
ENTRYPOINT ["/app/auth_server"] |
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,26 @@ | ||
#!/bin/bash | ||
|
||
# Copied from https://github.com/envoyproxy/envoy/blob/a12869fa9e9add4301a700978d5489e6a0cc0526/test/exe/envoy_static_test.sh. | ||
|
||
if [[ $(uname) == "Darwin" ]]; then | ||
echo "macOS doesn't support statically linked binaries, skipping." | ||
exit 0 | ||
fi | ||
|
||
# We can't rely on the exit code alone, since ldd fails for statically linked binaries. | ||
DYNLIBS=$(ldd "$1" 2>&1) || { | ||
if [[ ! "${DYNLIBS}" =~ 'not a dynamic executable' ]]; then | ||
echo "${DYNLIBS}" | ||
exit 1 | ||
fi | ||
} | ||
|
||
if [[ "${DYNLIBS}" =~ libc\+\+ ]]; then | ||
echo "libc++ is dynamically linked:" | ||
echo "${DYNLIBS}" | ||
exit 1 | ||
elif [[ "${DYNLIBS}" =~ libstdc\+\+ || "${DYNLIBS}" =~ libgcc ]]; then | ||
echo "libstdc++ and/or libgcc are dynamically linked:" | ||
echo "${DYNLIBS}" | ||
exit 1 | ||
fi |