2019-02-16 20:13:19 +01:00
|
|
|
# -*-Dockerfile-*-
|
2022-03-07 09:25:34 +01:00
|
|
|
|
2022-12-30 02:07:29 +01:00
|
|
|
ARG ALPINE_VERSION=3.17
|
2023-04-18 00:54:10 +02:00
|
|
|
ARG GO_VERSION=1.20
|
2023-04-18 06:35:24 +02:00
|
|
|
ARG GOSU_VERSION=1.16
|
2022-03-07 09:25:34 +01:00
|
|
|
|
|
|
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder-gosu
|
|
|
|
ARG GOSU_VERSION
|
|
|
|
RUN go install -ldflags "-s -w" github.com/tianon/gosu@${GOSU_VERSION}
|
|
|
|
|
|
|
|
FROM alpine:${ALPINE_VERSION} AS builder-onedrive
|
|
|
|
|
|
|
|
RUN apk add --update --no-cache alpine-sdk gnupg xz curl-dev sqlite-dev binutils-gold autoconf automake ldc
|
|
|
|
|
2019-02-16 20:13:19 +01:00
|
|
|
COPY . /usr/src/onedrive
|
2022-03-07 09:25:34 +01:00
|
|
|
WORKDIR /usr/src/onedrive
|
|
|
|
|
|
|
|
RUN autoreconf -fiv \
|
|
|
|
&& ./configure \
|
|
|
|
&& make clean \
|
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
FROM alpine:${ALPINE_VERSION}
|
|
|
|
|
2023-04-18 00:54:10 +02:00
|
|
|
RUN apk add --upgrade apk-tools \
|
|
|
|
&& apk upgrade --available
|
|
|
|
|
2022-03-07 09:25:34 +01:00
|
|
|
RUN apk add --update --no-cache bash libcurl libgcc shadow sqlite-libs ldc-runtime \
|
|
|
|
&& mkdir -p /onedrive/conf /onedrive/data
|
|
|
|
|
|
|
|
COPY --from=builder-gosu /go/bin/gosu /usr/local/bin/
|
|
|
|
COPY --from=builder-onedrive /usr/local/bin/onedrive /usr/local/bin/
|
|
|
|
|
2019-06-11 10:40:05 +02:00
|
|
|
COPY contrib/docker/entrypoint.sh /
|
2022-03-07 09:25:34 +01:00
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|