diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..804659a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:16.04 +MAINTAINER koalaman + +RUN apt-get update -y && \ + apt-get -y --no-install-recommends install git cabal-install && \ + apt-get clean && \ + apt-get autoremove && \ + rm -rf /var/lib/apt/lists/* + +RUN git config --global http.sslVerify false +WORKDIR /root +RUN git clone https://github.com/koalaman/shellcheck.git +WORKDIR /root/shellcheck +RUN cabal update && cabal install + +ENTRYPOINT ["/root/.cabal/bin/shellcheck"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..ca4e368 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,12 @@ +This docker image wraps [shellcheck](https://github.com/koalaman/shellcheck) as a single executable. + +## Build the image + + cd shellcheck/docker + docker build -t shellcheck . + +## How to use it + +For example, you have a shell script named `sample.sh` under the current directory, you can lint it by running: + + docker run -v $(pwd):/tmp/work shellcheck /tmp/work/sample.sh