From 071d112af7546cabc387626d383b06e547a1ab88 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Fri, 25 Aug 2023 15:49:32 +0000 Subject: [PATCH] Adding dockerfile to repo. Updating the version to 1.0.0 --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ entrypoint.sh | 6 ++++++ version.txt | 1 + 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 entrypoint.sh create mode 100644 version.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e036c0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:22.04 + +# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions +RUN apt update +RUN apt install -y sudo +RUN addgroup nonroot + +RUN sudo apt-get update +#Instalando Curl +RUN sudo apt-get install -y curl +#Instalando wget +RUN sudo apt-get install -y wget + +#Instalando devtunnel +#Comandos que no se deben olvidar correr al crear el devtunnel +#devtunnel user login -g -d +#devtunnel token TUNNELID --scope connect +RUN curl -sL https://aka.ms/DevTunnelCliInstall | bash + +#Instalando VSCode +RUN sudo apt-get update && sudo apt-get install -y gnupg2 +RUN sudo apt-get install -y software-properties-common +RUN sudo wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - +RUN sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" +RUN sudo apt update +RUN sudo apt install code -y + +#Making home writteable +RUN sudo chmod -R a+rwX /home + +RUN sudo sysctl -w fs.inotify.max_user_watches=524288 + +ADD ./entrypoint.sh /usr/bin/entrypoint.sh +RUN sudo chmod +x /usr/bin/entrypoint.sh + +ENTRYPOINT ["/usr/bin/entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..d32020f --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +exec [[ -z "${HOME_USER}" ]] && adduser --disabled-password --gecos "" vscode \ + echo 'vscode ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \ + || adduser --disabled-password --gecos "" ${HOME_USER} \ + echo '${HOME_USER} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers +exec [[ -z "${VSCODE_TUNNEL_NAME}" ]] && code tunnel --accept-server-license-terms || code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME} \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file