From b354440d60b9d3a42942d84a52d67f321b589027 Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 2 Apr 2020 17:46:45 +0530 Subject: [PATCH] Adds ubuntu based Dockerfile --- .travis.yml | 9 +++++++++ Dockerfile | 21 ++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8f9d5e..549a6bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,17 @@ language: crystal +env: + # Path to 'hadolint' binary + HADOLINT: "${HOME}/hadolint" + +install: + # Download hadolint binary and set it as executable + - curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/v1.17.5/hadolint-$(uname -s)-$(uname -m)" + && chmod 700 ${HADOLINT} script: - crystal spec - crystal tool format --check + - git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT} addons: apt: diff --git a/Dockerfile b/Dockerfile index 626bc68..fd06a59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,24 @@ -FROM jrei/crystal-alpine as builder +FROM ubuntu:19.04 WORKDIR /build COPY . . -RUN shards install && shards build --release --static +# Add the key for the crystal debian repo +ADD https://keybase.io/crystal/pgp_keys.asc /tmp/crystal.gpg -FROM scratch +# Install gnupg for the apt-key operation and openssl for our TLS stuff +RUN apt-get update && \ + apt-get install --yes --no-install-recommends gnupg=2.2.12-1ubuntu3 libssl-dev=1.1.1b-1ubuntu2.4 && \ + # 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 && \ + apt-get install --no-install-recommends --yes crystal=0.33.0-1 pdftk=2.02-5 && \ + # Cleanup + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -COPY --from=builder /build/bin/muse-dl / +RUN shards install && shards build --release -ENTRYPOINT ["/muse-dl"] \ No newline at end of file +ENTRYPOINT ["/build/bin/muse-dl"] \ No newline at end of file