Created
September 10, 2023 10:15
-
-
Save eramax/e083a250302306a6263bd869f5073b1b to your computer and use it in GitHub Desktop.
coder.Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu as base | |
LABEL maintainer="Ahmed Morsi" | |
ENV TZ Europe/Stockholm | |
ENV DEBIAN_FRONTEND noninteractive | |
# apps | |
RUN apt-get update && apt-get install -y curl tzdata nano htop cargo nodejs npm yarn build-essential git cmake locales zsh btop sudo iputils-ping wget tree jq python3 python3-pip | |
RUN apt-get -y autoremove | |
RUN apt-get -y clean | |
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen | |
RUN locale-gen | |
RUN update-locale LANG=en_US.UTF-8 | |
RUN useradd -m coder -s /bin/zsh -g root -G sudo -u 1001 | |
RUN echo 'coder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
RUN curl -fsSL https://code-server.dev/install.sh | sh | |
FROM base | |
LABEL maintainer="Ahmed Morsi" | |
USER coder | |
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | |
RUN sh -c "git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" | |
RUN sh -c "git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" | |
RUN sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/' ~/.zshrc | |
RUN git config --global --add oh-my-zsh.hide-dirty 1 | |
# entrypoint | |
RUN { \ | |
echo '#!/bin/bash -eu'; \ | |
#echo 'ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime'; \ | |
echo 'echo "coder:${CODER_PASSWORD}" | sudo chpasswd'; \ | |
echo 'exec code-server --bind-addr 0.0.0.0:80 --auth none "$@"'; \ | |
} > /home/coder/entry_point.sh | |
RUN chmod +x /home/coder/entry_point.sh | |
EXPOSE 22 | |
ENV CODER_PASSWORD P@sswrd | |
ENTRYPOINT ["/home/coder/entry_point.sh"] | |
#ENTRYPOINT ["tail", "-f", "/dev/null"] | |
#CMD ["/usr/sbin/sshd", "-D", "-e"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deployment.yml