老师,我基于 golang:1.22-bookworm 镜像搭建了一个 go 的开发环境
我想问下,如何在 docker 中安装 docker,我在网上查了一些方法,都没有成功安装
下面是我的 Dockerfile
FROM golang:1.22-bookworm
ENV MYPATH /root/astak
WORKDIR $MYPATH
ENV SHELL /bin/bash
ENV LANG C.UTF-8
ADD z /root/.z_jump
# RUN apt-get update && apt-get install -y sudo zsh tree vim exa fzf
RUN apt-get update && apt-get install -y sudo zsh tree vim exa fzf openssh-server silversearcher-ag fd-find rsync \
&& git config --global init.defaultBranch main \
&& yes | ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key \
&& ssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key
# dotfiles
ADD bashrc /root/.bashrc
RUN echo '[ -f /root/.bashrc ] && source /root/.bashrc' >> /root/.zshrc; \
echo '[ -f /root/.zshrc.local ] && source /root/.zshrc.local' >> /root/.zshrc
RUN mkdir -p /root/.config; \
touch /root/.config/.profile; ln -s /root/.config/.profile /root/.profile; \
touch /root/.config/.gitconfig; ln -s /root/.config/.gitconfig /root/.gitconfig; \
touch /root/.config/.zsh_history; ln -s /root/.config/.zsh_history /root/.zsh_history; \
touch /root/.config/.z; ln -s /root/.config/.z /root/.z; \
# touch /root/.config/.rvmrc; ln -s /root/.config/.rvmrc /root/.rvmrc; \
touch /root/.config/.bashrc; ln -s /root/.config/.bashrc /root/.bashrc.local; \
touch /root/.config/.zshrc; ln -s /root/.config/.zshrc /root/.zshrc.local;
# end