-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support user build-arg * simplify * set default user
- Loading branch information
1 parent
f33b020
commit a9430a4
Showing
3 changed files
with
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
FROM alpine:3.18.2 | ||
|
||
ARG TARGETDIR | ||
ARG USERNAME | ||
|
||
RUN addgroup -S -g 65532 ng-user && \ | ||
RUN if [ "$USERNAME" = "ng-user" ]; then \ | ||
addgroup -S -g 65532 ng-user && \ | ||
adduser -S -D -H -u 65532 \ | ||
-s /sbin/nologin -G ng-user -g ng-user ng-user | ||
-s /sbin/nologin -G ng-user -g ng-user ng-user; \ | ||
fi | ||
|
||
ADD bin/${TARGETDIR}/controller-manager /usr/local/bin/controller-manager | ||
ADD bin/${BUILDPLATFORM}/autoscaler /usr/local/bin/autoscaler | ||
ADD bin/${TARGETDIR}/autoscaler /usr/local/bin/autoscaler | ||
ADD bin/${TARGETDIR}/scheduler /usr/local/bin/scheduler | ||
USER 65532:65532 | ||
|
||
# [Optional] Set the default user. Omit if you want to keep the default as root. | ||
USER $USERNAME |
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,12 +1,17 @@ | ||
FROM alpine:3.18.2 | ||
|
||
ARG TARGETPLATFORM | ||
ARG USERNAME | ||
|
||
RUN addgroup -S -g 65532 ng-user && \ | ||
RUN if [ "$USERNAME" = "ng-user" ]; then \ | ||
addgroup -S -g 65532 ng-user && \ | ||
adduser -S -D -H -u 65532 \ | ||
-s /sbin/nologin -G ng-user -g ng-user ng-user | ||
-s /sbin/nologin -G ng-user -g ng-user ng-user; \ | ||
fi | ||
|
||
ADD bin/${TARGETPLATFORM}/controller-manager /usr/local/bin/controller-manager | ||
ADD bin/${TARGETPLATFORM}/autoscaler /usr/local/bin/autoscaler | ||
ADD bin/${TARGETPLATFORM}/scheduler /usr/local/bin/scheduler | ||
USER 65532:65532 | ||
|
||
# [Optional] Set the default user. Omit if you want to keep the default as root. | ||
USER $USERNAME |
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