Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +17 -17
Dockerfile
CHANGED
|
@@ -10,31 +10,31 @@ RUN apt-get update && apt-get install -y && \
|
|
| 10 |
DEBIAN_FRONTEND=noninteractive apt-get install gcc g++ gdb clangd wget git curl jq tzdata cron -y && \
|
| 11 |
curl -fsSL https://code-server.dev/install.sh | sh
|
| 12 |
|
| 13 |
-
COPY settings.json /
|
| 14 |
-
COPY config.yaml /
|
| 15 |
-
COPY create_languagepacks.sh /home/
|
| 16 |
-
COPY cph-ng-0.5.5.vsix /home/
|
| 17 |
-
COPY vscode-luogu.vsix /home/
|
| 18 |
-
RUN chmod +x /home/
|
| 19 |
|
| 20 |
# 配置git自动提交
|
| 21 |
-
COPY autocommit.sh /usr/
|
| 22 |
-
RUN chmod +x /usr/
|
| 23 |
-
RUN echo "30 2 */2 * * root /bin/bash /usr/
|
| 24 |
RUN chmod 0644 /etc/cron.d/autocommit-cron
|
| 25 |
|
| 26 |
# 设置工作目录和用户
|
| 27 |
-
WORKDIR /home/
|
| 28 |
|
| 29 |
# 配置codeserver的语言和扩展
|
| 30 |
-
RUN code-server --install-extension /home/
|
| 31 |
-
code-server --install-extension /home/
|
| 32 |
code-server --install-extension ms-ceintl.vscode-language-pack-zh-hans && \
|
| 33 |
code-server --install-extension hediet.vscode-drawio && \
|
| 34 |
code-server --install-extension formulahendry.code-runner && \
|
| 35 |
code-server --install-extension llvm-vs-code-extensions.vscode-clangd
|
| 36 |
|
| 37 |
-
RUN /home/
|
| 38 |
|
| 39 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
| 40 |
--mount=type=secret,id=GH_USERNAME,mode=0444,required=true \
|
|
@@ -42,16 +42,16 @@ RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
|
| 42 |
--mount=type=secret,id=GH_EMAIL,mode=0444,required=true \
|
| 43 |
git config --global user.name $(cat /run/secrets/GH_USERNAME) && \
|
| 44 |
git config --global user.email $(cat /run/secrets/GH_EMAIL) && \
|
| 45 |
-
git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/$(cat /run/secrets/GH_USERNAME)/$(cat /run/secrets/REPO_NAME).git /home/
|
| 46 |
|
| 47 |
RUN echo "#!/bin/bash \n \
|
| 48 |
cron & \
|
| 49 |
-
exec code-server /home/
|
| 50 |
-
RUN chmod +x /home/
|
| 51 |
|
| 52 |
# 暴露端口
|
| 53 |
EXPOSE 8080
|
| 54 |
EXPOSE 7860
|
| 55 |
|
| 56 |
# 将启动脚本设为容器入口
|
| 57 |
-
CMD ["/home/
|
|
|
|
| 10 |
DEBIAN_FRONTEND=noninteractive apt-get install gcc g++ gdb clangd wget git curl jq tzdata cron -y && \
|
| 11 |
curl -fsSL https://code-server.dev/install.sh | sh
|
| 12 |
|
| 13 |
+
COPY settings.json /root/.local/share/code-server/User/
|
| 14 |
+
COPY config.yaml /root/.config/code-server/
|
| 15 |
+
COPY create_languagepacks.sh /home/
|
| 16 |
+
COPY cph-ng-0.5.5.vsix /home/
|
| 17 |
+
COPY vscode-luogu.vsix /home/
|
| 18 |
+
RUN chmod +x /home/create_languagepacks.sh
|
| 19 |
|
| 20 |
# 配置git自动提交
|
| 21 |
+
COPY autocommit.sh /usr/scripts/autocommit.sh
|
| 22 |
+
RUN chmod +x /usr/scripts/autocommit.sh
|
| 23 |
+
RUN echo "30 2 */2 * * root /bin/bash /usr/scripts/autocommit.sh" > /etc/cron.d/autocommit-cron
|
| 24 |
RUN chmod 0644 /etc/cron.d/autocommit-cron
|
| 25 |
|
| 26 |
# 设置工作目录和用户
|
| 27 |
+
WORKDIR /home/
|
| 28 |
|
| 29 |
# 配置codeserver的语言和扩展
|
| 30 |
+
RUN code-server --install-extension /home/cph-ng-0.5.5.vsix && \
|
| 31 |
+
code-server --install-extension /home/vscode-luogu.vsix && \
|
| 32 |
code-server --install-extension ms-ceintl.vscode-language-pack-zh-hans && \
|
| 33 |
code-server --install-extension hediet.vscode-drawio && \
|
| 34 |
code-server --install-extension formulahendry.code-runner && \
|
| 35 |
code-server --install-extension llvm-vs-code-extensions.vscode-clangd
|
| 36 |
|
| 37 |
+
RUN /home/create_languagepacks.sh
|
| 38 |
|
| 39 |
RUN --mount=type=secret,id=GH_TOKEN,mode=0444,required=true \
|
| 40 |
--mount=type=secret,id=GH_USERNAME,mode=0444,required=true \
|
|
|
|
| 42 |
--mount=type=secret,id=GH_EMAIL,mode=0444,required=true \
|
| 43 |
git config --global user.name $(cat /run/secrets/GH_USERNAME) && \
|
| 44 |
git config --global user.email $(cat /run/secrets/GH_EMAIL) && \
|
| 45 |
+
git clone https://$(cat /run/secrets/GH_TOKEN)@github.com/$(cat /run/secrets/GH_USERNAME)/$(cat /run/secrets/REPO_NAME).git /home/cpp_competition
|
| 46 |
|
| 47 |
RUN echo "#!/bin/bash \n \
|
| 48 |
cron & \
|
| 49 |
+
exec code-server /home/cpp_competition" > /home/start.sh
|
| 50 |
+
RUN chmod +x /home/start.sh
|
| 51 |
|
| 52 |
# 暴露端口
|
| 53 |
EXPOSE 8080
|
| 54 |
EXPOSE 7860
|
| 55 |
|
| 56 |
# 将启动脚本设为容器入口
|
| 57 |
+
CMD ["/home/start.sh"]
|