Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Syntax3rror404 committed Aug 24, 2024
1 parent 41d5f12 commit 64d91b7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ RUN addgroup --gid 1001 devgroup && \
adduser --uid 1001 --ingroup devgroup --shell /bin/bash --home /home/dev --disabled-password dev && \
echo "dev ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# SSH configuration for rootless container
RUN mkdir -p /etc/ssh/keys /var/run/sshd && \
# Ensure SSH configuration and host keys are set up
RUN mkdir -p /var/run/sshd && \
ssh-keygen -A && \
cp /etc/ssh/ssh_host_* /etc/ssh/keys/ && \
chown -R root:root /etc/ssh/keys && \
chmod 600 /etc/ssh/keys/* && \
chown -R root:root /etc/ssh && \
chmod 600 /etc/ssh/ssh_host_* && \
echo 'dev:dev' | chpasswd && \
sed -i 's|#PermitRootLogin prohibit-password|PermitRootLogin no|' /etc/ssh/sshd_config && \
sed -i 's|#PasswordAuthentication yes|PasswordAuthentication no|' /etc/ssh/sshd_config
Expand Down
1 change: 1 addition & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
ports:
- containerPort: {{ .Values.service.port }}
securityContext:
fsGroup: 1001
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation }}
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

image:
source: ghcr.io/syntax3rror404/k8s-devmachine@sha256:0579081ba89ffeda377518c26fbf9a6454caec2039a41dc9262372c7dce186f0
source: ghcr.io/syntax3rror404/k8s-devmachine@sha256:3c87b57891380491fcb251e01aa86bfbee89b18f09cc003289ccb7df094951c5
pullPolicy: IfNotPresent

service:
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Ensure SSH host keys are available; generate them if they do not exist
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
echo "SSH host keys not found, generating new keys."
echo "Generating new SSH host keys."
ssh-keygen -A
fi

Expand Down

0 comments on commit 64d91b7

Please sign in to comment.