更新 Dockerfile
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
mol
2024-02-24 05:25:01 +00:00
parent f5892bd78b
commit 3ce27807ff

View File

@ -3,13 +3,15 @@ FROM codercom/code-server
EXPOSE 8080
EXPOSE 22
USER root
WORKDIR /root
USER coder
WORKDIR /home/coder
VOLUME [ "/home/coder/project", "/root/.ssh", "/root/.local", "/root/.config" ]
COPY entrypoint.sh /usr/bin/
RUN chmod 777 /usr/bin/entrypoint.sh
VOLUME [ "/root/project", "/root/.ssh", "/root/.local", "/root/.config" ]
USER root
# 运行时可以添加代理
ARG PROXY
@ -19,7 +21,7 @@ RUN echo "安装基础工具与配置文件" && \
export http_proxy=${PROXY} && \
export https_proxy=${PROXY} && \
# 设置shell
echo -e "set meta-flag on \nset convert-meta off \nset input-meta on \nset output-meta on" > /root/.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 install -y tzdata && \
@ -33,7 +35,8 @@ RUN echo "安装基础工具与配置文件" && \
# 安装 ssh 服务
apt-get install -y openssh-server && \
# 创建日志文件
touch info.log
touch /tmp/log/info.log && \
chmod 777 /tmp/log/info.log
# 安装 node 环境
RUN echo "安装 node 环境" && \
@ -93,6 +96,7 @@ RUN echo "配置 ssh" && \
# npm install --global npm@^8 && \
# npm config set python python3 && \
# npm install --global code-server --unsafe-perm
USER coder
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."]