From ac0103a1eec6c450becd9d8a1a9415100b7c414f Mon Sep 17 00:00:00 2001 From: Mmx <36563672+Mmx233@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:41:26 +0800 Subject: [PATCH] Improve: use alpine as dockerfile base image (#309) * build: use alpine as base image * build: use alpine edge instead of latest --- Dockerfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a709f94..d0bb0e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,17 @@ -FROM ubuntu:focal-20221130 - -ENV TZ="Asia/Shanghai" +FROM alpine:edge ARG TARGETOS ARG TARGETARCH -COPY ./script/entrypoint.sh /entrypoint.sh +RUN apk update && \ + apk upgrade --no-cache && \ + apk add --no-cache tzdata && \ + cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ + echo 'Asia/Shanghai' >/etc/timezone && \ + rm -rf /var/cache/apk/* -RUN export DEBIAN_FRONTEND="noninteractive" && \ - apt update && apt install -y ca-certificates tzdata && \ - update-ca-certificates && \ - ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && \ - dpkg-reconfigure tzdata && \ - chmod +x /entrypoint.sh +COPY ./script/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh WORKDIR /dashboard COPY dist/dashboard-${TARGETOS}-${TARGETARCH} ./app