slim commands
This commit is contained in:
parent
deb5f8d77e
commit
fa576b42c9
34
Dockerfile
34
Dockerfile
@ -1,33 +1,18 @@
|
|||||||
# LABEL authors="fly"
|
|
||||||
|
|
||||||
# ENTRYPOINT ["top", "-b"]
|
|
||||||
|
|
||||||
# 使用 Ubuntu 作为基础镜像
|
# 使用 Ubuntu 作为基础镜像
|
||||||
FROM dockerp.com/ubuntu:20.04
|
FROM dockerp.com/ubuntu:20.04
|
||||||
|
|
||||||
# 设置环境变量
|
# 设置环境变量
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# 使用南京大学的 apt 源
|
# 使用南京大学的 apt 源并安装常用工具和编译器
|
||||||
RUN sed -i 's/archive.ubuntu.com/mirrors.nju.edu.cn/g' /etc/apt/sources.list
|
RUN sed -i 's/archive.ubuntu.com/mirrors.nju.edu.cn/g' /etc/apt/sources.list && \
|
||||||
|
apt-get update && apt-get install -y \
|
||||||
# 更新系统并安装常用工具
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
curl \
|
curl \
|
||||||
wget \
|
wget \
|
||||||
git \
|
git \
|
||||||
build-essential \
|
build-essential \
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# 安装 Node.js(替换为南京大学的源)
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
||||||
# sed -i 's|deb.nodesource.com|mirror.nju.edu.cn/nodesource/deb|g' /etc/apt/sources.list.d/nodesource.list && \
|
|
||||||
apt-get update && apt-get install -y nodejs && npm config set registry https://repo.nju.edu.cn/repository/npm/ # 修改源
|
|
||||||
|
|
||||||
# 安装其他语言的编译器和工具
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
gcc g++ make \
|
gcc g++ make \
|
||||||
openjdk-11-jdk \
|
openjdk-11-jdk \
|
||||||
python3 python3-pip \
|
python3 python3-pip \
|
||||||
@ -38,19 +23,22 @@ RUN apt-get update && apt-get install -y \
|
|||||||
ghc cabal-install \
|
ghc cabal-install \
|
||||||
perl \
|
perl \
|
||||||
lua5.3 \
|
lua5.3 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
||||||
|
|
||||||
|
# 安装 Node.js 和 NPM(南京大学源)
|
||||||
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||||
|
apt-get update && apt-get install -y nodejs && \
|
||||||
|
npm config set registry https://repo.nju.edu.cn/repository/npm/ && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
|
||||||
|
|
||||||
# 安装 .NET SDK
|
# 安装 .NET SDK
|
||||||
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
|
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
|
||||||
dpkg -i packages-microsoft-prod.deb && \
|
dpkg -i packages-microsoft-prod.deb && \
|
||||||
apt-get update && apt-get install -y dotnet-sdk-6.0 && \
|
apt-get update && apt-get install -y dotnet-sdk-6.0 && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/* /var/cache/apt/* packages-microsoft-prod.deb
|
||||||
|
|
||||||
# 设置工作目录
|
# 设置工作目录
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# 暴露端口(如有需要)
|
|
||||||
#EXPOSE 3000
|
|
||||||
|
|
||||||
# 默认启动 Bash
|
# 默认启动 Bash
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
Loading…
Reference in New Issue
Block a user