summaryrefslogtreecommitdiff
path: root/contrib/build-using-docker/Dockerfile
blob: c56cacd35bebd4e81d75c6a4065cdf009953cac2 (plain)
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

ARG PARENT_IMAGE=alpine:3.16.0
FROM $PARENT_IMAGE

ARG GIT_TAG=
ARG CONFIGURE_OPTS=
ARG PKGINIT=true
ARG PKGADD="apk add"
ARG PKGDEL="apk del"
ARG PKGCLEAN=true
ARG PKGS_TO_ADD="curl gcc git make musl-dev tar"
ARG PKGS_TO_DEL="curl gcc git make musl-dev tar"

WORKDIR /work

RUN true \
    && $PKGINIT \
    && $PKGADD $PKGS_TO_ADD \
    && git clone --depth 1 https://github.com/hiddenalpha/bulk-ln.git . \
    && git config advice.detachedHead false \
    && if test -n "$GIT_TAG"; then git checkout "$GIT_TAG"; fi \
    && ./configure $CONFIGURE_OPTS \
    && make clean && make && make install \
    && find . -not -wholename './dist*' -delete \
    && find /work -exec chown 1000:1000 {} + \
    && $PKGDEL $PKGS_TO_DEL \
    && $PKGCLEAN \
    && true

USER 1000:1000

# run for max 10 hrs. Because this container is not meant to stay running
# forever.
CMD ["sleep", "36000"]