From 072aa5fd36aceff9ac5f3c4ed7127b29d027cd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20St=C3=B6ger?= Date: Tue, 24 Oct 2023 09:54:21 +0000 Subject: [PATCH 1/2] Update Dockerfile, installing python3 and npm --- coder/Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/coder/Dockerfile b/coder/Dockerfile index 8fe6a33..aedde29 100644 --- a/coder/Dockerfile +++ b/coder/Dockerfile @@ -1,8 +1,20 @@ -FROM docker.io/codercom/code-server:latest +FROM docker.io/codercom/code-server:latest as base RUN whoami USER root + +RUN apt-get update +RUN apt-get install -y \ + npm \ + python3 +RUN rm -rf /var/lib/apt/lists/* + +FROM base as builder + RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +FROM builder as prod + USER coder RUN mkdir -p /home/coder/.config/code-server/ RUN echo "bind-addr: 127.0.0.1:8080\nauth: none\ncert: false" > /home/coder/.config/code-server/config.yaml -- GitLab From 97683765b548151b0717f0027d4a2a17ae3267ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20St=C3=B6ger?= Date: Tue, 24 Oct 2023 10:26:29 +0000 Subject: [PATCH 2/2] Update Dockerfile --- coder/Dockerfile | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/coder/Dockerfile b/coder/Dockerfile index aedde29..dd0f1d2 100644 --- a/coder/Dockerfile +++ b/coder/Dockerfile @@ -3,12 +3,21 @@ RUN whoami USER root RUN apt-get update +RUN apt install software-properties-common -y + +FROM base as sys_install +RUN whoami +USER root +# RUN add-apt-repository ppa:deadsnakes/ppa +# RUN apt-get update RUN apt-get install -y \ npm \ - python3 + curl \ + python3-pip RUN rm -rf /var/lib/apt/lists/* +RUN curl https://pyenv.run | bash -FROM base as builder +FROM sys_install as builder RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl @@ -16,7 +25,20 @@ RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl FROM builder as prod USER coder + +RUN curl https://pyenv.run | bash + RUN mkdir -p /home/coder/.config/code-server/ RUN echo "bind-addr: 127.0.0.1:8080\nauth: none\ncert: false" > /home/coder/.config/code-server/config.yaml RUN cat /home/coder/.config/code-server/config.yaml RUN kubectl +RUN echo "# pyenv" >> .bashrc +RUN echo "export PATH=\"$HOME/.pyenv/bin:$PATH\"" >> .bashrc +RUN echo "eval \"$(pyenv init --path)\"" >> .bashrc +RUN echo "eval \"$(pyenv virtualenv-init -)\"" >> .bashrc + +RUN python3 --version +RUN pip3 --version +RUN $HOME/.pyenv/bin/pyenv --version +RUN $HOME/.pyenv/bin/pyenv install 3.12.0 +RUN $HOME/.pyenv/bin/pyenv versions -- GitLab