-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.aarch64
70 lines (53 loc) · 2.15 KB
/
Dockerfile.aarch64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
ARG ALPINE_VERSION="3.10"
ARG S6_OVERLAY_VERSION="1.22.1.0"
FROM golang:1.12-alpine${ALPINE_VERSION} AS builder
ARG GPHOTOS_UPLOADER_CLI_VERSION="1.0.6"
ENV GOOS=linux \
GOARCH=arm64
COPY patches /tmp/patches
RUN \
apk update && \
apk add --no-cache --virtual build-dependencies \
curl \
g++ \
git \
make && \
export QEMU_USER_STATIC_LATEST_TAG=$(curl -s https://api.github.com/repos/multiarch/qemu-user-static/tags \
| grep 'name.*v[0-9]' | head -n 1 | cut -d '"' -f 4) && \
curl -SL "https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_USER_STATIC_LATEST_TAG}/x86_64_qemu-aarch64-static.tar.gz" \
| tar xzv --directory /go/bin && \
git clone https://github.com/gphotosuploader/gphotos-uploader-cli.git \
--branch v${GPHOTOS_UPLOADER_CLI_VERSION} \
--single-branch && \
cd /go/gphotos-uploader-cli && \
git apply /tmp/patches/gphotos-uploader-cli/*.patch \
--ignore-whitespace \
--verbose && \
make build VERSION="${GPHOTOS_UPLOADER_CLI_VERSION}-docker" && \
apk del build-dependencies
FROM arm64v8/alpine:${ALPINE_VERSION}
LABEL maintainer="master@ricardoamaral.net"
ARG BUILD_DATE
ARG S6_OVERLAY_VERSION
ARG VCS_REF
LABEL \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.description="Mass upload media folders to your Google Photos account with this Docker image." \
org.label-schema.name="rfgamaral/gphotos-uploader" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.vcs-url="https://github.com/rfgamaral/docker-gphotos-uploader.git"
ENV GPU_SCHEDULE="0 */8 * * *"
COPY --from=builder /go/bin/qemu-aarch64-static /usr/bin/
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-aarch64.tar.gz /tmp/
RUN \
apk update && \
apk add --no-cache \
ca-certificates \
openssl && \
tar xzf /tmp/s6-overlay-aarch64.tar.gz --directory / && \
rm -rf /tmp/*
COPY --from=builder /go/gphotos-uploader-cli /usr/local/bin/
COPY rootfs/ /
VOLUME ["/config", "/photos"]
ENTRYPOINT ["/init"]