Merge branch 'simplify_dockerbuild' of https://github.com/pratikmallya/shellcheck into pratikmallya-simplify_dockerbuild

This commit is contained in:
Vidar Holen 2018-03-15 09:53:50 -07:00
commit 5364701914
1 changed files with 22 additions and 7 deletions

View File

@ -1,10 +1,25 @@
FROM ubuntu:16.04 AS build
# Install GHC and cabal
USER root
WORKDIR /opt/shellCheck
COPY . .
RUN apt-get update && apt-get install -y \
ghc \
cabal-install
RUN cabal update && \
cabal install --dependencies-only
RUN cabal build Paths_ShellCheck && \
ghc -optl-static -optl-pthread -idist/build/autogen --make shellcheck && \
strip --strip-all shellcheck
RUN mkdir -p /out/bin && \
cp shellcheck /out/bin/
FROM scratch
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
# This file assumes ShellCheck has already been built.
# See https://github.com/koalaman/scbuilder
COPY shellcheck /bin/shellcheck
WORKDIR /mnt
WORKDIR /
COPY --from=build /out /
ENTRYPOINT ["/bin/shellcheck"]