-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (54 loc) · 2.21 KB
/
Dockerfile
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
FROM eclipse-temurin:11-jre-alpine
ARG BUILD_DATE
ARG BUILD_REVISION
LABEL org.opencontainers.image.authors="mschmidtgit@protonmail.com"
LABEL org.opencontainers.image.vendor="Marco Schmidt"
LABEL org.opencontainers.image.title="marcoschmidt/am"
LABEL org.opencontainers.image.description="am: Asset Manager with Java, Perl and exiftool"
LABEL org.opencontainers.image.url="https://hub.docker.com/r/marcoschmidt/am"
LABEL org.opencontainers.image.source="https://github.com/marco-schmidt/am/blob/master/Dockerfile"
LABEL org.opencontainers.image.licenses="Apache-2.0"
# Requirement: must have run
# ./gradlew clean distTar
# so that a single file build/distributions/am-*.tar exists.
# update PATH to include paths to exiftool and am
ENV PATH="/opt/exiftool:/opt/am/bin:$PATH"
RUN set -eux \
&& java -version \
&& apk update \
&& apk upgrade \
# install perl and curl
&& apk add --no-cache curl perl \
&& curl --version \
&& perl -v \
# install exiftool
&& mkdir -p /opt/exiftool \
&& cd /opt/exiftool \
&& EXIFTOOL_VERSION=$(curl -s https://exiftool.org/ver.txt) \
&& EXIFTOOL_ARCHIVE=Image-ExifTool-${EXIFTOOL_VERSION}.tar.gz \
&& curl -s -O https://exiftool.org/$EXIFTOOL_ARCHIVE \
&& CHECKSUM=$(curl -s https://exiftool.org/checksums.txt | grep SHA1\(${EXIFTOOL_ARCHIVE} | awk -F'= ' '{print $2}') \
&& echo "${CHECKSUM} ${EXIFTOOL_ARCHIVE}" | /usr/bin/sha1sum -c -s - \
&& tar xzf $EXIFTOOL_ARCHIVE --strip-components=1 \
&& rm -f $EXIFTOOL_ARCHIVE \
&& exiftool -ver \
# create user and group am and several directories
&& mkdir -p /home/am \
&& addgroup -S am \
&& adduser -S -G am -h /home/am am \
&& mkdir -p /home/am/config \
&& mkdir /home/am/db \
&& mkdir /home/am/logs \
&& chown -R am:am /home/am
# labels using arguments, changing with every build
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.revision=$BUILD_REVISION
# copy am distribution tar file into image
COPY build/distributions/am-*.tar /opt
# unpack am tar file and delete it
RUN mkdir -p /opt/am \
&& cd /opt/am \
&& tar xf /opt/am-*.tar --strip-components=1 \
&& rm -f /opt/am-*.tar
USER am
ENTRYPOINT ["/bin/sh", "am", "--print-env", "--config", "/home/am/config/.am.properties"]