mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-21 04:42:46 +00:00
add extraOptions for stage 1 in two stage rsync add arch_exclude and arch_include support for two stage rsync add gitlab-ci dockerfile add dockerfile
38 lines
888 B
Docker
38 lines
888 B
Docker
FROM --platform=$TARGETPLATFORM golang:1.13-alpine as builder
|
|
|
|
RUN apk add git musl-dev gcc make --no-cache
|
|
|
|
ENV GO111MODULE on
|
|
|
|
ENV GOPROXY https://goproxy.cn
|
|
|
|
COPY * /mnt/
|
|
|
|
COPY .* /mnt/
|
|
|
|
RUN cd /mnt && git checkout twoStageRsync && make all
|
|
|
|
RUN cd / && git clone https://github.com/tuna/tunasync-scripts.git
|
|
|
|
FROM --platform=$TARGETPLATFORM alpine:3
|
|
|
|
RUN apk update && apk add --no-cache rsync wget htop bash python3 && \
|
|
mkdir -p /app && mkdir /data && rm -rf /var/cache/apk/*
|
|
|
|
RUN wget http://ftp-master.debian.org/ftpsync.tar.gz && tar -vxf *.tar.gz -C / && rm -rf *.tar.gz && cp -rf /distrib/* / && rm -rf /distrib
|
|
|
|
|
|
# 使用变量必须申明
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
|
|
|
COPY --from=builder /mnt/build-${TARGETOS}-${TARGETARCH}*/* /app/bin/
|
|
|
|
COPY --from=builder /tunasync-scripts /home/scripts
|
|
|
|
ENV PATH="${PATH}:/app/bin"
|
|
|
|
WORKDIR /app
|
|
|
|
ENTRYPOINT [ "/app/bin/tunasync" ] |