From be9be64dc90fc8e622dfa8d2b805ead925975700375cc49d9a2d089724500929 Mon Sep 17 00:00:00 2001 From: KoCoder Date: Wed, 3 Jul 2024 21:09:48 +0200 Subject: [PATCH] Build a dockerfile with VSCode, node, git and an ssh server --- ubuntu-vscode-node/Dockerfile | 31 +++++++++++++++++++++++++++ ubuntu-vscode-node/vscode-config.yaml | 4 ++++ 2 files changed, 35 insertions(+) create mode 100644 ubuntu-vscode-node/Dockerfile create mode 100644 ubuntu-vscode-node/vscode-config.yaml diff --git a/ubuntu-vscode-node/Dockerfile b/ubuntu-vscode-node/Dockerfile new file mode 100644 index 0000000..331052f --- /dev/null +++ b/ubuntu-vscode-node/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/ubuntu-vscode-node/vscode-config.yaml b/ubuntu-vscode-node/vscode-config.yaml new file mode 100644 index 0000000..1bd700b --- /dev/null +++ b/ubuntu-vscode-node/vscode-config.yaml @@ -0,0 +1,4 @@ +bind-addr: 0.0.0.0:65000 +auth: none +password: false +cert: false \ No newline at end of file