use non root user for building image (#2449)
Signed-off-by: Jeff <zw0948@gmail.com>
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
# Copyright 2018 The KubeSphere Authors. All rights reserved.
|
||||
# Copyright 2020 The KubeSphere Authors. All rights reserved.
|
||||
# Use of this source code is governed by an Apache license
|
||||
# that can be found in the LICENSE file.
|
||||
FROM alpine:3.9
|
||||
RUN apk add --update ca-certificates && update-ca-certificates
|
||||
|
||||
COPY /bin/cmd/ks-apiserver /usr/local/bin/
|
||||
|
||||
RUN apk add --update ca-certificates && \
|
||||
update-ca-certificates && \
|
||||
adduser -D -g kubesphere -u 1002 kubesphere && \
|
||||
chown -R kubesphere:kubesphere /usr/local/bin/ks-apiserver
|
||||
|
||||
USER kubesphere
|
||||
CMD ["sh"]
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
# Copyright 2018 The KubeSphere Authors. All rights reserved.
|
||||
# Copyright 2020 The KubeSphere Authors. All rights reserved.
|
||||
# Use of this source code is governed by an Apache license
|
||||
# that can be found in the LICENSE file.
|
||||
FROM alpine:3.7
|
||||
RUN apk add --update ca-certificates && update-ca-certificates
|
||||
|
||||
COPY /bin/cmd/controller-manager /usr/local/bin/
|
||||
|
||||
RUN apk add --update ca-certificates && \
|
||||
update-ca-certificates && \
|
||||
adduser -D -g kubesphere -u 1002 kubesphere && \
|
||||
chown -R kubesphere:kubesphere /usr/local/bin/controller-manager
|
||||
|
||||
USER kubesphere
|
||||
CMD controller-manager
|
||||
|
||||
Reference in New Issue
Block a user