Last active
June 13, 2024 05:16
-
-
Save ManotLuijiu/72fb4956c5a9043e438c5ad3e953069b to your computer and use it in GitHub Desktop.
Install Coder's Workspace on Docker. In case you want to use locales, zsh and Oh-My-Zsh together with Coder-Server
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 | |
#FROM ubuntu:22.04 as base | |
RUN apt-get update \ | |
&& apt-get upgrade -y \ | |
&& apt-get install -y \ | |
curl \ | |
git \ | |
golang \ | |
sudo \ | |
nano \ | |
unzip \ | |
wget \ | |
locales \ | |
zsh \ | |
fonts-powerline \ | |
&& rm -rf /var/lib/apt/lists/* | |
ARG USER=yourusername | |
RUN useradd --groups sudo --create-home --shell /bin/zsh ${USER} \ | |
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \ | |
&& chmod 0440 /etc/sudoers.d/${USER} | |
USER ${USER} | |
WORKDIR /home/${USER} | |
# Ensure correct permissions for code-server settings directory | |
RUN sudo mkdir -p /home/${USER}/.local/share/code-server/User && \ | |
sudo chown -R ${USER}:${USER} /home/${USER}/.local && \ | |
sudo chmod -R 755 /home/${USER}/.local | |
RUN cd ~ | |
RUN sudo rm -rf .oh-my-zsh | |
RUN echo "Y" | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# Clone the powerlevel10k theme and plugins | |
RUN git clone https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k && \ | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \ | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
# Comment out the default plugins line and add custom theme and plugins to .zshrc | |
RUN sed -i 's/^ZSH_THEME="robbyrussell"/#&/' ~/.zshrc && \ | |
sed -i 's/^plugins=(/##&/' ~/.zshrc && \ | |
echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrc && \ | |
echo 'plugins=( git zsh-syntax-highlighting zsh-autosuggestions )' >> ~/.zshrc | |
# Download, unzip, and install the AWS CLI with specified options | |
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ | |
&& unzip awscliv2.zip \ | |
&& sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update \ | |
&& rm -rf awscliv2.zip aws | |
CMD ["zsh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do these after creating a workspace