This commit is contained in:
22
Dockerfile
22
Dockerfile
@ -6,7 +6,7 @@ EXPOSE 22
|
||||
USER root
|
||||
WORKDIR /home/coder
|
||||
|
||||
VOLUME [ "/home/coder/project", "/home/coder/.ssh", "/home/coder/.local", "/home/coder/.config" ]
|
||||
VOLUME [ "/mnt/project", "/home/coder" ]
|
||||
|
||||
COPY entrypoint.sh /usr/bin/
|
||||
|
||||
@ -37,9 +37,7 @@ RUN echo "安装基础工具与配置文件" && \
|
||||
|
||||
# 安装 node 环境
|
||||
echo "安装 node 环境" && \
|
||||
# apt-get install -y npm && \
|
||||
# 安装 brew 管理器
|
||||
# git clone https://mirrors.aliyun.com/homebrew/install.git brew-install && \
|
||||
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" && \
|
||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" && \
|
||||
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" && \
|
||||
@ -50,19 +48,11 @@ RUN echo "安装基础工具与配置文件" && \
|
||||
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /root/.bashrc && \
|
||||
echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> /root/.bashrc && \
|
||||
echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"' >> /root/.bashrc && \
|
||||
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" && \
|
||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" && \
|
||||
apt-get install -y build-essential && \
|
||||
# /bin/bash /root/install.sh && \
|
||||
# rm -rf /root/install.sh && \
|
||||
#echo 'export HOMEBREW_API_DOMAIN="https://mirrors.aliyun.com/homebrew-bottles/api"' >> ~/.bash_profile && \
|
||||
##echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/brew.git"' >> ~/.bash_profile && \
|
||||
#echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.aliyun.com/homebrew/homebrew-core.git"' >> ~/.bash_profile && \
|
||||
#echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.aliyun.com/homebrew/homebrew-bottles"' >> ~/.bash_profile && \
|
||||
#source ~/.bash_profile && \
|
||||
brew update && \
|
||||
# 安装 n node 管理器
|
||||
brew install n && \
|
||||
ln -s /home/linuxbrew/.linuxbrew/bin/n /usr/bin/n && \
|
||||
export N_NODE_MIRROR=https://npmmirror.com/mirrors/node/ && \
|
||||
n 18.15.0 && \
|
||||
# 安装 nrm
|
||||
@ -75,12 +65,12 @@ RUN echo "安装基础工具与配置文件" && \
|
||||
|
||||
# 安装 python 环境
|
||||
echo "安装 python 环境" && \
|
||||
apt-get install -y python3 && \
|
||||
# python3.8-dev python3.8-venv python3-pip python3-wheel
|
||||
apt-get install -y python3 python3-dev python3-venv python3-pip python3-wheel && \
|
||||
ln -s /usr/bin/python3 /usr/bin/python && \
|
||||
|
||||
# 安装 docker 环境
|
||||
echo "安装 docker 环境" && \
|
||||
apt-get install -y docker.io && \
|
||||
# echo "安装 docker 环境" && \
|
||||
# apt-get install -y docker.io && \
|
||||
|
||||
# 配置 ssh
|
||||
echo "配置 ssh" && \
|
||||
|
@ -21,8 +21,6 @@ if [ "${DOCKER_USER-}" ]; then
|
||||
sudo groupmod -n "$DOCKER_USER" "$USER_HOME"
|
||||
#sudo printf "user: $DOCKER_USER\ngroup: $DOCKER_USER\n" > /etc/fixuid/config.yml
|
||||
|
||||
sudo chown -R "$DOCKER_USER":999 /home/coder
|
||||
|
||||
|
||||
if [ -e "/home/coder/.gitconfig" ]; then
|
||||
echo "git配置文件已存在"
|
||||
@ -45,6 +43,7 @@ if [ "${DOCKER_USER-}" ]; then
|
||||
echo "docker 用户登录完成"
|
||||
fi
|
||||
|
||||
sudo chown -R "$DOCKER_USER":999 /home/coder
|
||||
# 移除无密码sudo
|
||||
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
|
||||
fi
|
||||
@ -64,5 +63,5 @@ ssh-agent bash
|
||||
if [ -d "${ENTRYPOINTD}" ]; then
|
||||
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
|
||||
fi
|
||||
echo "$@"
|
||||
su "$(id -un 1000)" -c "exec dumb-init /usr/bin/code-server --bind-addr 0.0.0.0:8080 ."
|
||||
|
||||
su "$(id -un 1000)" -c "exec dumb-init /usr/bin/code-server $@"
|
||||
|
Reference in New Issue
Block a user