From 52b041b77180ba2ef50a0db2b5b5ef6c4a86f43c Mon Sep 17 00:00:00 2001 From: devome Date: Wed, 17 Nov 2021 10:56:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?alpine=E4=B8=8Bjar=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=80=80=E5=87=BA=EF=BC=8C=E5=B0=9D=E8=AF=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8ubuntu=E8=A7=A3=E5=86=B3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 20 +++++++++---------- buildx.sh | 2 +- .../nginxwebui/run => entrypoint.sh | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename s6-overlay/etc/services.d/nginxwebui/run => entrypoint.sh (75%) diff --git a/Dockerfile b/Dockerfile index c931447c..86eaa825 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,27 @@ -FROM alpine:3.14 +FROM ubuntu +ARG DEBIAN_FRONTEND=noninteractive ENV LANG=zh_CN.UTF-8 \ TZ=Asia/Shanghai \ PS1="\u@\h:\w \$ " -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \ - && apk add --update --no-cache \ +RUN apt update \ + && apt install -y --no-install-recommends \ nginx \ - nginx-mod-stream \ - openjdk8-jre \ + libnginx-mod-stream \ + openjdk-11-jre \ net-tools \ curl \ wget \ ttf-dejavu \ fontconfig \ tzdata \ - s6-overlay \ - acme.sh \ - sqlite \ + tini \ + sqlite3 \ && fc-cache -f -v \ && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ && echo "${TZ}" > /etc/timezone \ && rm -rf /var/cache/apk/* /tmp/* COPY target/nginxWebUI-*.jar /home/nginxWebUI.jar -COPY s6-overlay / +COPY entrypoint.sh /usr/local/bin/entrypoint.sh VOLUME ["/home/nginxWebUI"] -ENTRYPOINT ["/init"] +ENTRYPOINT ["tini", "entrypoint.sh"] diff --git a/buildx.sh b/buildx.sh index f14e479e..c8128f92 100755 --- a/buildx.sh +++ b/buildx.sh @@ -7,7 +7,7 @@ ## 基本信息 repo="${1:-cym1102}/nginxwebui" -arch="linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x" +arch="linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/riscv64,linux/s390x" ver=$(cat pom.xml | grep -A1 nginxWebUI | grep version | grep -oP "\d+\.\d+\.\d+") echo "构建镜像:$repo" echo "构建架构:$arch" diff --git a/s6-overlay/etc/services.d/nginxwebui/run b/entrypoint.sh similarity index 75% rename from s6-overlay/etc/services.d/nginxwebui/run rename to entrypoint.sh index 8280b029..49d25e58 100755 --- a/s6-overlay/etc/services.d/nginxwebui/run +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv sh +#!/bin/bash cd /home exec java -jar -Xmx64m nginxWebUI.jar "${BOOT_OPTIONS}" 2>&1 >/dev/null -- Gitee From 28b8c1a2bc07ebf2bb27f157b7d6a8cd8200043d Mon Sep 17 00:00:00 2001 From: devome Date: Wed, 17 Nov 2021 11:06:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=87=8D=E7=BD=AEdockerignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 2 +- Dockerfile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6aa34829..ab14ee09 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ * !target/nginxWebUI-*.jar !Dockerfile -!s6-overlay +!entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 86eaa825..1e0655b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,11 @@ RUN apt update \ && fc-cache -f -v \ && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ && echo "${TZ}" > /etc/timezone \ - && rm -rf /var/cache/apk/* /tmp/* + && apt autoclean -y \ + && rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* COPY target/nginxWebUI-*.jar /home/nginxWebUI.jar COPY entrypoint.sh /usr/local/bin/entrypoint.sh VOLUME ["/home/nginxWebUI"] -- Gitee