Files

80 lines
4.0 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ver: 1.11 by Endial Fang (endial@126.com)
#
# 系统默认变量 ====================================================================
# 该部分变量为系统根据编译命令默认设置
# `TARGETPLATFORM`:构建后的目标平台信息。如 `linux/amd64``linux/arm/v7``windows/amd64`
# `TARGETOS`:目标平台信息(TARGETPLATFORM)中的操作系统部分,如:`linux`、`windows`
# `TARGETARCH`:目标平台信息(TARGETPLATFORM)中的平台架构部分,如:`amd64`、`arm`
# `TARGETVARIANT`:目标平台信息(TARGETPLATFORM)中的版本变体部分,如:`v7`
# `BUILDPLATFORM`:用于构建的节点平台信息
# `BUILDOS`:用于构建的节点平台信息(BUILDPLATFORM)中的操作系统部分
# `BUILDARCH`:用于构建的节点平台信息(BUILDPLATFORM)中的平台架构部分
# `BUILDVARIANT`:用于构建的节点平台信息(BUILDPLATFORM)中的版本变体部分
# 可变参数 ========================================================================
# 该部分变量,在编译命令中通过 `--build-arg` 传入;如果未设置,则使用下面对应的默认值
ARG APP_NAME=dBuilder
ARG APP_VER=13
ARG REGISTRY_URL="docker.io/"
ARG APT_SOURCE=aliyun
# 1. 生成镜像 =====================================================================
FROM ${REGISTRY_URL}debian:${APP_VER}
# 声明需要使用的全局可变参数(ARG声明的变量仅编译打包阶段有效)
ARG APP_NAME
ARG APP_VER
ARG APT_SOURCE
# 镜像元数据标签 - 符合OCI镜像规范
LABEL org.opencontainers.image.title="${APP_NAME}" \
org.opencontainers.image.version="${APP_VER}" \
org.opencontainers.image.description="Docker image for Debian Builder." \
org.opencontainers.image.authors="Endial Fang <endial@126.com>" \
org.opencontainers.image.url="https://gitee.com/colovu/docker-${APP_NAME}" \
org.opencontainers.image.vendor="Endial Fang (colovu)" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.source="https://gitee.com/colovu/docker-${APP_NAME}" \
org.opencontainers.image.documentation="https://gitee.com/colovu/docker-${APP_NAME}/blob/main/README.md" \
maintainer="Endial Fang <endial@126.com>"
# 拷贝源仓库配置文件
COPY customer /
# 拷贝默认的通用脚本文件
COPY .ci/common/debian /
# 以下命令安装的软件包
# apt-transport-https apt-utils binutils binutils-common
# binutils-x86-64-linux-gnu build-essential bzip2 ca-certificates cmake
# cmake-data cpp cpp-8 curl dirmngr distro-info-data dpkg-dev g++ g++-8 gcc
# gcc-8 git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client
# gpg-wks-server gpgconf gpgsm iproute2 iputils-ping libapt-inst2.0
# libarchive13 libasan5 libassuan0 libatomic1 libbinutils libc-dev-bin
# libc6-dev libcap2 libcap2-bin libcc1-0 libcmocka-dev libcmocka0
# libcurl3-gnutls libcurl4 libdpkg-perl libelf1 liberror-perl libexpat1
# libgcc-8-dev libgdbm-compat4 libgdbm6 libglib2.0-0 libgomp1 libgssapi-krb5-2
# libicu63 libisl19 libitm1 libjsoncpp1 libk5crypto3 libkeyutils1 libkrb5-3
# libkrb5support0 libksba8 libldap-2.4-2 libldap-common liblsan0 libmnl0
# libmpc3 libmpdec2 libmpfr6 libmpx2 libncurses6 libnghttp2-14 libnpth0
# libpcre2-8-0 libperl5.28 libprocps7 libpsl5 libpython3-stdlib
# libpython3.7-minimal libpython3.7-stdlib libquadmath0 libreadline7 librhash0
# librtmp1 libsasl2-2 libsasl2-modules-db libsqlite3-0 libssh2-1 libssl-dev
# libssl3 libstdc++-8-dev libtsan0 libubsan1 libuv1 libxml2 libxtables12
# linux-libc-dev lsb-base lsb-release make mime-support nano net-tools openssl
# 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 set -eux; \
select_source ${APT_SOURCE}; \
\
install_pkg sudo wget curl 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;
CMD []