Skip to content

Commit

Permalink
Merge pull request #124 from andyzhangx/nonroot
Browse files Browse the repository at this point in the history
fix: create nonroot user in Dockerfile
  • Loading branch information
andyzhangx authored Sep 30, 2020
2 parents 93873a8 + e5e0558 commit 341d133
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS Unit Tests
name: MacOS Build & Unit Test
on:
push:
branches: [ master ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux Unit tests
name: Ubuntu Test
on:
push:
branches: [ master ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Windows Unit Tests
name: Windows Build & Unit Test
on:
push:
branches: [ master ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ spec:
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
securityContext:
runAsUser: 0
volumeMounts:
- mountPath: /csi
name: socket-dir
Expand Down
1 change: 1 addition & 0 deletions charts/latest/csi-driver-smb/templates/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ spec:
fieldPath: spec.nodeName
securityContext:
privileged: true
runAsUser: 0
volumeMounts:
- mountPath: /csi
name: socket-dir
Expand Down
2 changes: 2 additions & 0 deletions deploy/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ spec:
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock
securityContext:
runAsUser: 0
volumeMounts:
- mountPath: /csi
name: socket-dir
Expand Down
1 change: 1 addition & 0 deletions deploy/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ spec:
fieldPath: spec.nodeName
securityContext:
privileged: true
runAsUser: 0
volumeMounts:
- mountPath: /csi
name: socket-dir
Expand Down
4 changes: 4 additions & 0 deletions pkg/smbplugin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ RUN clean-install ca-certificates cifs-utils util-linux e2fsprogs mount udev xfs
LABEL maintainers="andyzhangx"
LABEL description="SMB CSI Driver"

# Create a nonroot user
RUN useradd -u 10001 nonroot
USER nonroot

COPY ./_output/smbplugin /smbplugin
ENTRYPOINT ["/smbplugin"]
4 changes: 4 additions & 0 deletions pkg/smbplugin/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ RUN apt-get update && apt-get install -y ca-certificates cifs-utils util-linux e
LABEL maintainers="andyzhangx"
LABEL description="SMB CSI Driver"

# Create a nonroot user
RUN useradd -u 10001 nonroot
USER nonroot

COPY ./_output/smbplugin /smbplugin
ENTRYPOINT ["/smbplugin"]

0 comments on commit 341d133

Please sign in to comment.