feat: 优化 Dockerfile
This commit is contained in:
+12
-12
@@ -17,7 +17,7 @@
|
||||
# 该部分变量,在编译命令中通过 `--build-arg` 传入;如果未设置,则使用下面对应的默认值
|
||||
|
||||
# 设置当前应用名称及版本
|
||||
ARG APP_NAME=dBuilder
|
||||
ARG APP_NAME=dbuilder
|
||||
ARG APP_VER=12
|
||||
|
||||
# 设置默认仓库地址,默认为本地仓库;定义时需要包含末尾的`/`
|
||||
@@ -36,21 +36,14 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} ${REGISTRY_URL}colovu/debian:${AP
|
||||
# 声明需要使用的全局可变参数
|
||||
ARG APP_NAME
|
||||
ARG APP_VER
|
||||
ARG REGISTRY_URL
|
||||
ARG APT_SOURCE
|
||||
ARG LOCAL_URL
|
||||
ARG TARGETARCH
|
||||
|
||||
LABEL \
|
||||
"Version"="v${APP_VER}" \
|
||||
"Description"="Docker image for Builder based on Debian." \
|
||||
"Github"="https://github.com/colovu/docker-dbuilder" \
|
||||
"Github"="https://github.com/colovu/docker-${APP_NAME}" \
|
||||
"Vendor"="Endial Fang (endial@126.com)"
|
||||
|
||||
|
||||
# 选择软件包源(Optional),以加速后续软件包安装
|
||||
RUN select_source ${APT_SOURCE}
|
||||
|
||||
# 以下命令安装的软件包
|
||||
# apt-transport-https apt-utils binutils binutils-common
|
||||
# binutils-x86-64-linux-gnu build-essential bzip2 ca-certificates cmake
|
||||
@@ -72,9 +65,16 @@ RUN select_source ${APT_SOURCE}
|
||||
# patch perl perl-modules-5.28 pinentry-curses pkg-config procps python3
|
||||
# python3-minimal python3.7 python3.7-minimal readline-common sudo wget
|
||||
# xz-utils
|
||||
RUN install_pkg sudo wget curl git ca-certificates iproute2 net-tools nano dpkg gnupg \
|
||||
RUN set -eux; \
|
||||
\
|
||||
# 选择软件包源
|
||||
select_source ${APT_SOURCE}; \
|
||||
\
|
||||
# 安装编译环境及常用开发库
|
||||
install_pkg sudo wget git ca-certificates iproute2 net-tools nano dpkg gnupg \
|
||||
dirmngr apt-utils apt-transport-https lsb-release iputils-ping \
|
||||
build-essential cmake libcmocka-dev pkg-config libssl3 libssl-dev \
|
||||
libtool libltdl7 libltdl-dev
|
||||
build-essential cmake libcmocka-dev pkg-config \
|
||||
libssl3 libssl-dev \
|
||||
libtool libltdl7 libltdl-dev;
|
||||
|
||||
CMD []
|
||||
|
||||
Reference in New Issue
Block a user