diff --git a/5.0/.dockerignore b/5.0/.dockerignore index b3e8a3d..70e323c 100644 --- a/5.0/.dockerignore +++ b/5.0/.dockerignore @@ -1,4 +1,7 @@ .git .gitignore README.md -LICENSE \ No newline at end of file +LICENSE +*.yml +*.yaml +img diff --git a/5.0/Dockerfile b/5.0/Dockerfile index 02e060c..edfb211 100644 --- a/5.0/Dockerfile +++ b/5.0/Dockerfile @@ -1,7 +1,11 @@ # Ver: 1.0 by Endial Fang (endial@126.com) # -# 指定原始系统镜像,常用镜像为 colovu/ubuntu:18.04、colovu/debian:10-buster、colovu/alpine:3.11、colovu/openjdk:8u252-jre -FROM colovu/ubuntu:18.04 +# 指定原始系统镜像,常用镜像为 colovu/ubuntu:18.04、colovu/debian:10、colovu/alpine:3.12、colovu/openjdk:8u252-jre +FROM colovu/debian:10 + +# ARG参数使用"--build-arg"指定,如 "--build-arg apt_source=tencent" +# sources.list 可使用版本:default / tencent / ustc / aliyun / huawei +ARG apt_source=default # 外部指定应用版本信息,如 "--build-arg app_ver=6.0.0" ARG app_ver=5.0.8 @@ -52,6 +56,9 @@ RUN set -eux; \ # 设置容器入口脚本的可执行权限 chmod +x /usr/local/bin/entrypoint.sh; \ \ +# 更改源为当次编译指定的源 + cp /etc/apt/sources.list.${apt_source} /etc/apt/sources.list; \ + \ # 为应用创建对应的组、用户、相关目录 APP_DIRS="${APP_DEF_DIR:-} ${APP_CONF_DIR:-} ${APP_DATA_DIR:-} ${APP_CACHE_DIR:-} ${APP_RUN_DIR:-} ${APP_LOG_DIR:-} ${APP_CERT_DIR:-} ${APP_WWW_DIR:-} ${APP_DATA_LOG_DIR:-} ${APP_BASE_DIR:-${APP_DATA_DIR}}"; \ mkdir -p ${APP_DIRS}; \ @@ -62,8 +69,6 @@ RUN set -eux; \ appDeps=" \ libnss-wrapper \ xz-utils \ - locales \ - tzdata \ "; \ \ \ @@ -132,15 +137,6 @@ RUN set -eux; \ \ \ \ -# 为中国区使用重新配置 TimeZone 信息。需要安装 tzdata 软件包 - ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \ - dpkg-reconfigure -f noninteractive tzdata; \ - \ -# 安装 UTF-8 编码。需要安装 locales 软件包 - localedef -c -i en_US -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8; \ - echo 'en_GB.UTF-8 UTF-8\nen_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen; \ - update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=POSIX && dpkg-reconfigure locales; \ - \ # 检测是否存在对应版本的 overrides 脚本文件;如果存在,执行 { [ ! -e "/usr/local/overrides/overrides-${APP_VERSION}.sh" ] || /bin/bash "/usr/local/overrides/overrides-${APP_VERSION}.sh"; }; \ \ @@ -168,9 +164,6 @@ RUN set -eux; \ gosu ${APP_USER} redis-cli --version; \ gosu ${APP_USER} redis-server --version; -ENV LANG=en_US.UTF-8 \ - LANGUAGE=en_US.UTF-8 \ - LC_ALL=en_US.UTF-8 VOLUME ["/srv/conf", "/srv/data", "/var/log", "/var/run"] diff --git a/6.0/.dockerignore b/6.0/.dockerignore index b3e8a3d..70e323c 100644 --- a/6.0/.dockerignore +++ b/6.0/.dockerignore @@ -1,4 +1,7 @@ .git .gitignore README.md -LICENSE \ No newline at end of file +LICENSE +*.yml +*.yaml +img diff --git a/6.0/Dockerfile b/6.0/Dockerfile index cb9fed5..97b2fd6 100644 --- a/6.0/Dockerfile +++ b/6.0/Dockerfile @@ -1,7 +1,11 @@ # Ver: 1.0 by Endial Fang (endial@126.com) # -# 指定原始系统镜像,常用镜像为 colovu/ubuntu:18.04、colovu/debian:10-buster、colovu/alpine:3.11、colovu/openjdk:8u252-jre -FROM colovu/ubuntu:18.04 +# 指定原始系统镜像,常用镜像为 colovu/ubuntu:18.04、colovu/debian:10、colovu/alpine:3.12、colovu/openjdk:8u252-jre +FROM colovu/debian:10 + +# ARG参数使用"--build-arg"指定,如 "--build-arg apt_source=tencent" +# sources.list 可使用版本:default / tencent / ustc / aliyun / huawei +ARG apt_source=default # 外部指定应用版本信息,如 "--build-arg app_ver=6.0.0" ARG app_ver=6.0.5 @@ -52,6 +56,9 @@ RUN set -eux; \ # 设置容器入口脚本的可执行权限 chmod +x /usr/local/bin/entrypoint.sh; \ \ +# 更改源为当次编译指定的源 + cp /etc/apt/sources.list.${apt_source} /etc/apt/sources.list; \ + \ # 为应用创建对应的组、用户、相关目录 APP_DIRS="${APP_DEF_DIR:-} ${APP_CONF_DIR:-} ${APP_DATA_DIR:-} ${APP_CACHE_DIR:-} ${APP_RUN_DIR:-} ${APP_LOG_DIR:-} ${APP_CERT_DIR:-} ${APP_WWW_DIR:-} ${APP_DATA_LOG_DIR:-} ${APP_BASE_DIR:-${APP_DATA_DIR}}"; \ mkdir -p ${APP_DIRS}; \ @@ -62,8 +69,6 @@ RUN set -eux; \ appDeps=" \ libnss-wrapper \ xz-utils \ - locales \ - tzdata \ "; \ \ \ @@ -123,15 +128,6 @@ RUN set -eux; \ \ \ \ -# 为中国区使用重新配置 TimeZone 信息。需要安装 tzdata 软件包 - ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \ - dpkg-reconfigure -f noninteractive tzdata; \ - \ -# 安装 UTF-8 编码。需要安装 locales 软件包 - localedef -c -i en_US -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8; \ - echo 'en_GB.UTF-8 UTF-8\nen_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen; \ - update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=POSIX && dpkg-reconfigure locales; \ - \ # 检测是否存在对应版本的 overrides 脚本文件;如果存在,执行 { [ ! -e "/usr/local/overrides/overrides-${APP_VERSION}.sh" ] || /bin/bash "/usr/local/overrides/overrides-${APP_VERSION}.sh"; }; \ \ @@ -159,9 +155,6 @@ RUN set -eux; \ gosu ${APP_USER} redis-cli --version; \ gosu ${APP_USER} redis-server --version; -ENV LANG=en_US.UTF-8 \ - LANGUAGE=en_US.UTF-8 \ - LC_ALL=en_US.UTF-8 VOLUME ["/srv/conf", "/srv/data", "/var/log", "/var/run"]