更新 Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
mol
2024-02-24 13:16:02 +00:00
parent c3f53625e3
commit 8ef545d5ee

View File

@ -12,14 +12,9 @@ COPY entrypoint.sh /usr/bin/
ENV ENTRYPOINTD=/entrypoint.d ENV ENTRYPOINTD=/entrypoint.d
# 运行时可以添加代理
ARG PROXY
# 安装基础工具与配置文件 # 安装基础工具与配置文件
RUN echo "安装基础工具与配置文件" && \ RUN echo "安装基础工具与配置文件" && \
echo ${PROXY} && \ sed -i -e 's/deb.debian.org/mirrors.huaweicloud.com/g' -e 's/security.debian.org/mirrors.huaweicloud.com/g' /etc/apt/sources.list && \
export http_proxy=${PROXY} && \
export https_proxy=${PROXY} && \
# 设置shell # 设置shell
echo -e "set meta-flag on \nset convert-meta off \nset input-meta on \nset output-meta on" > /home/coder/.inputrc && \ echo -e "set meta-flag on \nset convert-meta off \nset input-meta on \nset output-meta on" > /home/coder/.inputrc && \
apt-get update && \ apt-get update && \
@ -38,44 +33,32 @@ RUN echo "安装基础工具与配置文件" && \
mkdir /tmp/log && \ mkdir /tmp/log && \
touch /tmp/log/info.log && \ touch /tmp/log/info.log && \
chmod 777 /tmp/log/info.log && \ chmod 777 /tmp/log/info.log && \
chmod 777 /usr/bin/entrypoint.sh chmod 777 /usr/bin/entrypoint.sh && \
# 安装 node 环境 # 安装 node 环境
RUN echo "安装 node 环境" && \ echo "安装 node 环境" && \
export http_proxy=${PROXY} && \
export https_proxy=${PROXY} && \
# 安装 brew
# curl -ofsSL install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash && \
# (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /root/.bashrc && \
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \
apt-get update && \
apt-get install -y nodejs npm && \ apt-get install -y nodejs npm && \
npm install -g n && \ # 安装 nrm
# apt-get install -y build-essential && \ npm install -g nrm --registry=http://registry.npmmirror.com && \
nrm use taobao && \
# 安装 n node 管理器 # 安装 n node 管理器
# brew install n && \ npm install -g n && \
# 安装最新版本 node # 安装最新版本 node
n 18.15.0 n 18.15.0 && \
# 安装 web 服务器 # 安装 web 服务器
# npm i -g live-server # npm i -g live-server
# 安装 python 环境 # 安装 python 环境
RUN echo "安装 python 环境" && \ echo "安装 python 环境" && \
export http_proxy=${PROXY} && \ apt-get install -y python3 && \
export https_proxy=${PROXY} && \
apt-get update && \
apt-get install -y python3
# python3.8-dev python3.8-venv python3-pip python3-wheel # python3.8-dev python3.8-venv python3-pip python3-wheel
# 安装 docker 环境 # 安装 docker 环境
RUN echo "安装 docker 环境" && \ echo "安装 docker 环境" && \
export http_proxy=${PROXY} && \ apt-get install -y docker.io && \
export https_proxy=${PROXY} && \
apt-get update && \
apt-get install -y docker.io
# 配置 ssh # 配置 ssh
RUN echo "配置 ssh" && \ echo "配置 ssh" && \
rm -f /etc/ssh/ssh_host_rsa_key && \ rm -f /etc/ssh/ssh_host_rsa_key && \
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' && \ ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' && \
rm -f /etc/ssh/ssh_host_dsa_key && \ rm -f /etc/ssh/ssh_host_dsa_key && \
@ -86,16 +69,5 @@ RUN echo "配置 ssh" && \
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' && \ ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N '' && \
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/" /etc/ssh/sshd_config
# 安装 code-server
# RUN echo "安装 code-server" && \
# export http_proxy=${PROXY} && \
# export https_proxy=${PROXY} && \
# apt update && \
# # apt-get install -y build-essential pkg-config python3 && \
# apt install -y pkg-config && \
# npm install --global npm@^8 && \
# npm config set python python3 && \
# npm install --global code-server --unsafe-perm
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."] ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."]