add golang installation

This commit is contained in:
xfy
2024-06-07 10:29:15 +08:00
parent 809ff6861c
commit 51ba5a285a

View File

@ -3,7 +3,7 @@ FROM ubuntu:noble
RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \
&& sed -i 's@//.*security.ubuntu.com@//mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources \
&& apt-get update -y \
&& apt-get install -y git ninja-build gettext cmake unzip curl build-essential sudo zsh \
&& apt-get install -y git ninja-build gettext cmake unzip curl build-essential sudo zsh htop \
&& cd /opt && git clone --depth 1 https://gitee.com/mirrors/neovim && cd neovim \
&& make CMAKE_BUILD_TYPE=Release \
&& make install \
@ -31,9 +31,15 @@ RUN export NVM_DIR="/home/$USER/.nvm" \
&& npm i -g yarn pnpm cgr
# rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# golang
RUN git clone https://github.com/go-nv/goenv.git /home/${USER}/.goenv \
&& /home/${USER}/.goenv/bin/goenv install 1.22.2 \
&& /home/${USER}/.goenv/bin/goenv global 1.22.2
# lazygit
RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*') \
&& curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
&& curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" \
&& mkdir -p /home/${USER}/.config/lazygit \
&& cp -a /home/${USER}/dotfiles/lazygit/mocha-pink.yml /home/${USER}/.config/lazygit
RUN tar zvxf lazygit.tar.gz lazygit
RUN sudo install lazygit /usr/local/bin \
&& rm -rf lazygit \