Added sshd to Dockerfile

This commit is contained in:
Gert-Jan Aalderink 2025-07-09 22:22:49 +02:00
parent c95af85c03
commit 72d8abb71c

View File

@ -1,6 +1,6 @@
FROM node:20 FROM node:20
# Basic tools # 🧰 Install basic tools
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
git \ git \
curl \ curl \
@ -9,12 +9,17 @@ RUN apt-get update && apt-get install -y \
openssh-server \ openssh-server \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Set up workspace # 🔐 Configure SSH
RUN mkdir -p /var/run/sshd \
&& echo "root:devpassword" | chpasswd \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# 🧱 Set up workspace
WORKDIR /workspace WORKDIR /workspace
# Optional: Install VS Code Server (commented by default) # 💻 Optional: Install VS Code Server
# RUN curl -fsSL https://code-server.dev/install.sh | sh # RUN curl -fsSL https://code-server.dev/install.sh | sh
# Default shell # 🚪 Start SSH and fallback to shell
CMD ["/bin/bash"] CMD service ssh start && bash