-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.online
More file actions
30 lines (23 loc) · 841 Bytes
/
Copy pathDockerfile.online
File metadata and controls
30 lines (23 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARG UBUNTU_VERSION=22.04
FROM ubuntu:${UBUNTU_VERSION}
WORKDIR /root
ARG IN_CHINA=false
# Ubuntu 24.04+ 使用 deb822 格式 (sources.list.d/*.sources)
# 旧版本使用传统 sources.list 格式
RUN \
if ${IN_CHINA}; \
then \
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then \
sed -i 's|URIs: http://archive.ubuntu.com/ubuntu/|URIs: http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list.d/ubuntu.sources; \
elif [ -f /etc/apt/sources.list ]; then \
sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu\//http:\/\/mirrors\.aliyun\.com\/ubuntu\//g' /etc/apt/sources.list; \
fi; \
fi
# 安装环境
ADD https://raw.githubusercontent.com/Pterosaur/linux-config/master/ubuntu-init.sh .ubuntu-init
RUN \
bash .ubuntu-init; \
bash .ubuntu-init dev; \
rm .ubuntu-init
CMD \
zsh