diff --git a/Dockerfile b/Dockerfile index 972d0dd..9f666ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,46 @@ FROM alpine:3.4 MAINTAINER sparklyballs -# copy files from jenkins builder job -COPY package/bin/shellcheck /usr/local/bin/ -COPY package/lib/ /usr/local/lib/ - -# load lib files -RUN \ - ldconfig /usr/local/lib - # set version label ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +# copy apk key +COPY mitch.tishmack@gmail.com-55881c97.rsa.pub /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub + +# install packages +RUN \ + echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/next/8.0" >> /etc/apk/repositories && \ + apk add --no-cache --virtual=build-dependencies \ + bash \ + binutils \ + cabal \ + g++ \ + gcc \ + ghc \ + ghc-dev \ + git \ + make \ + stack && \ + +# update cabal and stack + cabal \ + update && \ + stack \ + update && \ + +# compile shellcheck + cabal install ShellCheck && \ + cp /root/.cabal/bin/shellcheck /usr/local/bin/ && \ + ldd /root/.cabal/bin/shellcheck | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /usr/local/lib/ && \ + ldconfig /usr/local/lib && \ + +# clean up + apk del --purge \ + build-dependencies && \ + rm -rf \ + /tmp/* && \ + find /root -name . -o -prune -exec rm -rf -- {} + && \ + mkdir -p \ + /root diff --git a/Dockerfile_builder b/Dockerfile_builder deleted file mode 100644 index 6bea2ce..0000000 --- a/Dockerfile_builder +++ /dev/null @@ -1,53 +0,0 @@ -FROM alpine:3.4 -MAINTAINER sparklyballs - -# environment settings -ENV PATH ${PATH}:/root/.cabal/bin - -# copy apk key -COPY mitch.tishmack@gmail.com-55881c97.rsa.pub /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub - -# install packages -RUN \ - echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/next/8.0" >> /etc/apk/repositories && \ - apk add --no-cache \ - bash \ - binutils \ - cabal \ - g++ \ - gcc \ - ghc \ - ghc-dev \ - git \ - make \ - stack && \ - -# update cabal and stack - cabal \ - update && \ - stack \ - update && \ - -# clone shellcheck repo - git clone https://github.com/koalaman/shellcheck /usr/src/shellcheck - -# compile shellcheck -WORKDIR /usr/src/shellcheck -RUN \ - cabal install --only-dependencies -RUN \ - cabal install -RUN \ - cabal test - -# Get shellcheck binary -RUN mkdir -p /package/bin/ -RUN cp $(which shellcheck) /package/bin/ - -# Get shared libraries using magic -RUN mkdir -p /package/lib/ -RUN ldd $(which shellcheck) | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /package/lib/ - -# Copy shellcheck package out to mounted directory -CMD ["cp", "-avr", "/package", "/mnt/"] -