-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
189 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,6 @@ lcov.info | |
|
||
# Python venvs | ||
.venv | ||
|
||
# Docker stuff | ||
binaries |
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,30 @@ | ||
FROM debian:bullseye-slim as builder | ||
|
||
ARG TARGETPLATFORM | ||
ARG binary_dir | ||
ENV BINARY_DIR=${binary_dir} | ||
|
||
ARG binary_name | ||
ENV BINARY_NAME=${binary_name} | ||
|
||
COPY ${BINARY_DIR}/* /tmp/binaries/ | ||
# Select the correct binary and put it to a predictable location | ||
RUN case ${TARGETPLATFORM} in \ | ||
"linux/amd64") export TARGET="amd64" ;; \ | ||
"linux/arm64") export TARGET="arm64" ;; \ | ||
esac; \ | ||
mv /tmp/binaries/${BINARY_NAME}_${TARGET} /root/${BINARY_NAME} | ||
|
||
|
||
FROM debian:bullseye-slim | ||
|
||
ARG binary_name | ||
ENV BINARY_NAME=${binary_name} | ||
|
||
COPY --from=builder /root/${BINARY_NAME} /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/${BINARY_NAME} | ||
|
||
# run unprivileged | ||
USER 1001 | ||
|
||
CMD ["${BINARY_NAME}"] |
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
Oops, something went wrong.