muse-dl/Dockerfile

46 lines
1.2 KiB
Docker
Raw Normal View History

2020-04-03 22:09:35 +00:00
FROM debian:10-slim
2020-04-01 07:55:50 +00:00
WORKDIR /build
COPY . .
2020-04-02 12:16:45 +00:00
# Add the key for the crystal debian repo
ADD https://keybase.io/crystal/pgp_keys.asc /tmp/crystal.gpg
2020-04-01 07:55:50 +00:00
2020-04-03 22:09:35 +00:00
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 for why mkdir is needed
RUN mkdir -p /usr/share/man/man1 && \
apt-get update && \
apt-get install --yes --no-install-recommends \
# Install gnupg for the apt-key operation
2020-05-13 20:01:38 +00:00
gnupg \
2020-04-03 22:09:35 +00:00
# libssl for faster TLS in Crystal
2020-05-13 20:01:38 +00:00
libssl-dev \
2020-04-03 22:09:35 +00:00
# pdftk as a dependency for muse-dl
pdftk=2.02-5 \
# ca-certificates for talking to crystal-lang.org
2020-05-13 20:01:38 +00:00
ca-certificates \
2020-04-03 22:09:35 +00:00
# git to let shards install happen
2020-05-13 20:01:38 +00:00
git \
2020-04-04 21:38:57 +00:00
# needed by myhtml crystal shard
2020-05-13 20:01:38 +00:00
make \
2020-04-03 22:09:35 +00:00
# build --release
2020-05-13 20:01:38 +00:00
zlib1g-dev && \
2020-04-02 12:16:45 +00:00
# See https://crystal-lang.org/install/
apt-key add /tmp/crystal.gpg && \
echo "deb https://dist.crystal-lang.org/apt crystal main" > /etc/apt/sources.list.d/crystal.list && \
apt-get update && \
2020-05-13 22:10:42 +00:00
apt-get install --no-install-recommends --yes crystal=0.34.0-1 && \
2020-04-02 12:16:45 +00:00
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2020-04-01 07:55:50 +00:00
2020-04-03 22:09:35 +00:00
RUN shards install && shards build --release && \
ln /build/bin/muse-dl /usr/bin/muse-dl
RUN apt-get --yes remove git gnupg
2020-04-01 07:55:50 +00:00
2020-04-03 22:09:35 +00:00
WORKDIR /data
VOLUME /data
2020-04-03 19:39:53 +00:00
2020-05-13 20:01:38 +00:00
ENTRYPOINT ["/usr/bin/muse-dl"]