Improve: use alpine as dockerfile base image (#309)

* build: use alpine as base image

* build: use alpine edge instead of latest
This commit is contained in:
Mmx 2023-12-07 21:41:26 +08:00 committed by GitHub
parent f59b31590e
commit ac0103a1ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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