diff --git a/.devcontainer/dockerfile b/.devcontainer/dockerfile index efa5cc19672..65d5a664a22 100644 --- a/.devcontainer/dockerfile +++ b/.devcontainer/dockerfile @@ -8,7 +8,21 @@ RUN apt-get update && apt-get install -y \ curl \ gnupg2 \ lsb-release \ - software-properties-common + software-properties-common \ + openssh-server + +# Configure SSH server +RUN mkdir /var/run/sshd \ + && echo 'root:Docker!' | chpasswd \ + && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ + && sed -i 's@session required pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd \ + && echo "export VISIBLE=now" >> /etc/profile + +# Expose SSH port +EXPOSE 22 + +# Start SSH service +CMD ["/usr/sbin/sshd", "-D"] # Install .NET SDKs (6, 7, 8 and 9) RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh \ @@ -42,4 +56,4 @@ RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | # Clean up RUN rm dotnet-install.sh \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* \ No newline at end of file