File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,5 +64,6 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
6464LABEL io.artifacthub.package.logo-url="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png"
6565ENTRYPOINT ["kubectl" ]
6666
67- RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user
67+ RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user && mkdir -p /home/user/.kube && chown -R 999:100 /home/user && chmod 755 /home/user /home/user/.kube
68+
6869WORKDIR /home/user
Original file line number Diff line number Diff line change @@ -29,7 +29,18 @@ podman run --rm --name kubectl \
2929 -v /localpath/to/customize:/home/user:Z
3030 registry.opensuse.org/opensuse/kubectl:1.32 kustomize --enable-helm
3131```
32+ ## Running as a non-root user
3233
34+ By default, this container runs as the ` root ` user. However, it is prepared to run as a non-privileged user (UID ` 999 ` ) for enhanced security.
35+
36+ To run the container in rootless mode, you must explicitly set the user and the home environment variables:
37+
38+ ``` ShellSession
39+ podman run --rm --name kubectl \
40+ --user 999:100 \
41+ -e HOME=/home/user \
42+ -v /localpath/to/kubeconfig:/home/user/.kube/config:Z \
43+ registry.opensuse.org/opensuse/kubectl:1.32 get nodes
3344
3445## Licensing
3546
Original file line number Diff line number Diff line change @@ -64,5 +64,6 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
6464LABEL io.artifacthub.package.logo-url="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png"
6565ENTRYPOINT ["kubectl" ]
6666
67- RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user
67+ RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user && mkdir -p /home/user/.kube && chown -R 999:100 /home/user && chmod 755 /home/user /home/user/.kube
68+
6869WORKDIR /home/user
Original file line number Diff line number Diff line change @@ -29,7 +29,18 @@ podman run --rm --name kubectl \
2929 -v /localpath/to/customize:/home/user:Z
3030 registry.opensuse.org/opensuse/kubectl:1.33 kustomize --enable-helm
3131```
32+ ## Running as a non-root user
3233
34+ By default, this container runs as the ` root ` user. However, it is prepared to run as a non-privileged user (UID ` 999 ` ) for enhanced security.
35+
36+ To run the container in rootless mode, you must explicitly set the user and the home environment variables:
37+
38+ ``` ShellSession
39+ podman run --rm --name kubectl \
40+ --user 999:100 \
41+ -e HOME=/home/user \
42+ -v /localpath/to/kubeconfig:/home/user/.kube/config:Z \
43+ registry.opensuse.org/opensuse/kubectl:1.33 get nodes
3344
3445## Licensing
3546
Original file line number Diff line number Diff line change @@ -64,5 +64,6 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
6464LABEL io.artifacthub.package.logo-url="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png"
6565ENTRYPOINT ["kubectl" ]
6666
67- RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user
67+ RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user && mkdir -p /home/user/.kube && chown -R 999:100 /home/user && chmod 755 /home/user /home/user/.kube
68+
6869WORKDIR /home/user
Original file line number Diff line number Diff line change @@ -29,7 +29,18 @@ podman run --rm --name kubectl \
2929 -v /localpath/to/customize:/home/user:Z
3030 registry.opensuse.org/opensuse/kubectl:1.34 kustomize --enable-helm
3131```
32+ ## Running as a non-root user
3233
34+ By default, this container runs as the ` root ` user. However, it is prepared to run as a non-privileged user (UID ` 999 ` ) for enhanced security.
35+
36+ To run the container in rootless mode, you must explicitly set the user and the home environment variables:
37+
38+ ``` ShellSession
39+ podman run --rm --name kubectl \
40+ --user 999:100 \
41+ -e HOME=/home/user \
42+ -v /localpath/to/kubeconfig:/home/user/.kube/config:Z \
43+ registry.opensuse.org/opensuse/kubectl:1.34 get nodes
3344
3445## Licensing
3546
Original file line number Diff line number Diff line change @@ -65,5 +65,6 @@ LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"
6565LABEL io.artifacthub.package.logo-url="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png"
6666ENTRYPOINT ["kubectl" ]
6767
68- RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user
68+ RUN set -euo pipefail; echo "user:x:999:100:User for CLI:/home/user:/usr/sbin/nologin" >> /etc/passwd && install -d -o 999 -g 100 -m 0755 /home/user && mkdir -p /home/user/.kube && chown -R 999:100 /home/user && chmod 755 /home/user /home/user/.kube
69+
6970WORKDIR /home/user
Original file line number Diff line number Diff line change @@ -29,7 +29,18 @@ podman run --rm --name kubectl \
2929 -v /localpath/to/customize:/home/user:Z
3030 registry.opensuse.org/opensuse/kubectl:1.35 kustomize --enable-helm
3131```
32+ ## Running as a non-root user
3233
34+ By default, this container runs as the ` root ` user. However, it is prepared to run as a non-privileged user (UID ` 999 ` ) for enhanced security.
35+
36+ To run the container in rootless mode, you must explicitly set the user and the home environment variables:
37+
38+ ``` ShellSession
39+ podman run --rm --name kubectl \
40+ --user 999:100 \
41+ -e HOME=/home/user \
42+ -v /localpath/to/kubeconfig:/home/user/.kube/config:Z \
43+ registry.opensuse.org/opensuse/kubectl:1.35 get nodes
3344
3445## Licensing
3546
You can’t perform that action at this time.
0 commit comments