add ARG CONTRY=CN to improve the alpinelinux install speed
This commit is contained in:
@@ -32,7 +32,13 @@ FROM node:18-alpine AS builder-admin-frontend
|
||||
# Set working directory
|
||||
WORKDIR /frontend
|
||||
|
||||
RUN apk update && apk add git --no-cache
|
||||
ARG COUNTRY
|
||||
# Install required tools without caching index to minimize image size
|
||||
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||
echo "It is in China, updating the repositories"; \
|
||||
sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
||||
fi && \
|
||||
apk update && apk add --no-cache git
|
||||
|
||||
# Clone the frontend repository
|
||||
RUN git clone https://github.com/lejianwen/rustdesk-api-web .
|
||||
@@ -47,7 +53,13 @@ FROM alpine:latest
|
||||
WORKDIR /app
|
||||
|
||||
# Install necessary runtime dependencies
|
||||
RUN apk add --no-cache tzdata file
|
||||
# Install required tools without caching index to minimize image size
|
||||
ARG COUNTRY
|
||||
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||
echo "It is in China, updating the repositories"; \
|
||||
sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories; \
|
||||
fi && \
|
||||
apk update && apk add --no-cache tzdata file
|
||||
|
||||
# Copy the built application and resources from the builder stage
|
||||
COPY --from=builder-backend /app/release /app/
|
||||
|
||||
Reference in New Issue
Block a user