From 47175bce56aeee018c7768831700939e006cd3af Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 30 Jul 2021 18:18:41 -0300 Subject: [PATCH 1/3] Docker dev --- .devcontainer/.zshrc | 28 ++++++++++++++++++++++++++++ .devcontainer/Dockerfile | 24 +++++++++++++++--------- .devcontainer/devcontainer.json | 2 +- 3 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 .devcontainer/.zshrc diff --git a/.devcontainer/.zshrc b/.devcontainer/.zshrc new file mode 100644 index 0000000..397c431 --- /dev/null +++ b/.devcontainer/.zshrc @@ -0,0 +1,28 @@ +export ZSH="/home/vscode/.oh-my-zsh" +ZSH_THEME="strug" +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git zsh-syntax-highlighting zsh-autosuggestions) + +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) +# CASE_SENSITIVE="true" +# HYPHEN_INSENSITIVE="true" +# DISABLE_AUTO_UPDATE="true" +# DISABLE_UPDATE_PROMPT="true" +export UPDATE_ZSH_DAYS=1 +# DISABLE_MAGIC_FUNCTIONS="true" +# DISABLE_LS_COLORS="true" +# DISABLE_AUTO_TITLE="true" +# ENABLE_CORRECTION="true" +# COMPLETION_WAITING_DOTS="true" +# DISABLE_UNTRACKED_FILES_DIRTY="true" +# HIST_STAMPS="mm/dd/yyyy" +# ZSH_CUSTOM=/path/to/new-custom-folder +source $ZSH/oh-my-zsh.sh +# export MANPATH="/usr/local/man:$MANPATH" +export LANG=en_US.UTF-8 + +export EDITOR="code-insiders" + +# export ARCHFLAGS="-arch x86_64" +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2d2490d..c9b0e14 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,15 @@ -FROM bdsmaneger/node_image:latest -RUN export username="vscodedev" && \ - export password="1a113Luca" && \ - pass=$(perl -e 'print crypt($ARGV[0], "password")' $password); \ - useradd -m -p "$pass" "$username"; \ - addgroup ${username} sudo; addgroup ${username} root; \ - usermod --shell /bin/bash --home /home/bds ${username}; \ - echo "${username} ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers && \ - mkdir -p /home/ /base/ \ No newline at end of file +FROM ubuntu:latest +ENV DEBIAN_FRONTEND="noninteractive" + +# Install dependencies and other tools +RUN apt update && apt install -y zsh git curl wget sudo openjdk-16* python pyrhon3 +RUN curl https://deb.nodesource.com/setup_current.x | bash - && apt install -y nodejs +RUN useradd -M -s /usr/bin/zsh -p $(perl -e 'print crypt($ARGV[0], "password")' vscode) vscode; echo "vscode ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/vscode + +# User: vscode +USER vscode +WORKDIR /home/vscode +RUN yes | sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting +RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions +COPY .zshrc ./ \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fb6a451..48a3c53 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -37,5 +37,5 @@ // "postCreateCommand": "npm install --no-save", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscodedev" + "remoteUser": "vscode" } -- 2.49.0 From 46eb82eb79f2f063f7c8b80573cdd2fc62361f61 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 30 Jul 2021 18:26:13 -0300 Subject: [PATCH 2/3] .devcontainer/Dockerfile python --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c9b0e14..1782a6e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:latest ENV DEBIAN_FRONTEND="noninteractive" # Install dependencies and other tools -RUN apt update && apt install -y zsh git curl wget sudo openjdk-16* python pyrhon3 +RUN apt update && apt install -y zsh git curl wget sudo openjdk-16* python python3 RUN curl https://deb.nodesource.com/setup_current.x | bash - && apt install -y nodejs RUN useradd -M -s /usr/bin/zsh -p $(perl -e 'print crypt($ARGV[0], "password")' vscode) vscode; echo "vscode ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/vscode -- 2.49.0 From 439bf548197a6377db7844efab49803645bb23e0 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 30 Jul 2021 18:53:44 -0300 Subject: [PATCH 3/3] Update Dockerfile --- .devcontainer/Dockerfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1782a6e..d12d21a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,5 @@ -FROM ubuntu:latest -ENV DEBIAN_FRONTEND="noninteractive" - -# Install dependencies and other tools -RUN apt update && apt install -y zsh git curl wget sudo openjdk-16* python python3 -RUN curl https://deb.nodesource.com/setup_current.x | bash - && apt install -y nodejs +FROM bdsmaneger/node_image:latest +USER root RUN useradd -M -s /usr/bin/zsh -p $(perl -e 'print crypt($ARGV[0], "password")' vscode) vscode; echo "vscode ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/vscode # User: vscode -- 2.49.0