Build a dockerfile with VSCode, node, git and an ssh server

This commit is contained in:
Konstantin Hintermayer 2024-07-03 21:09:48 +02:00
parent c2016ad8b8
commit be9be64dc9
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,31 @@
FROM ubuntu:22.04
SHELL [ "/bin/bash", "--login", "-i", "-c" ]
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install apt-transport-https -y
# Install generic tools like sudo curl wget ssh here
RUN apt-get install openssh-server sudo curl wget nano vim git -y
RUN sudo systemctl enable ssh
# Install nvm and the latest lts version of node
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
RUN source ~/.bashrc && nvm install --lts
# Install vs code server
RUN curl -fsSL https://code-server.dev/install.sh | sh
RUN useradd -ms /bin/bash kocoded-workspaces -p "$(openssl passwd -1 ubuntu)"
RUN usermod -aG sudo kocoded-workspaces
RUN systemctl enable code-server@kocoded-workspaces
COPY vscode-config.yaml /home/kocoded-workspaces/.config/code-server/config.yaml
RUN chown -R kocoded-workspaces /home/kocoded-workspaces
EXPOSE 22
EXPOSE 65000
SHELL [ "/bin/bash", "--login", "-c" ]
CMD [ "/sbin/init", "&&", "/bin/bash" ]

View File

@ -0,0 +1,4 @@
bind-addr: 0.0.0.0:65000
auth: none
password: false
cert: false