diff --git a/coder/Dockerfile b/coder/Dockerfile index 8fe6a3373d0d3637e8455e313f8ca3c8e1c22869..dd0f1d276c6b2ec3ac93b05380d2e8c9ae8b380d 100644 --- a/coder/Dockerfile +++ b/coder/Dockerfile @@ -1,10 +1,44 @@ -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 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 \ + curl \ + python3-pip +RUN rm -rf /var/lib/apt/lists/* +RUN curl https://pyenv.run | bash + +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 + +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