Adds ubuntu based Dockerfile

This commit is contained in:
Nemo 2020-04-02 17:46:45 +05:30
parent ce0a901b47
commit b354440d60
2 changed files with 25 additions and 5 deletions

View File

@ -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:

View File

@ -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"]
ENTRYPOINT ["/build/bin/muse-dl"]