Skip to content

Commit

Permalink
Add Alpine-based docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
koalaman committed Oct 7, 2017
1 parent 3785a08 commit f73736e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ script:
- rm -rf dist || true
# Linux Docker image
- docker build -t "$DOCKER_REPO:$TAG" .
# Linux Alpine based Docker image
- sed 's/^FROM .*/FROM alpine:latest/' Dockerfile > Dockerfile.alpine
- docker build -f Dockerfile.alpine -t "$DOCKER_REPO-alpine:$TAG" .

after_success:
- ./.prepare_deploy
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- |-
([ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ]) && docker push "$DOCKER_REPO:$TAG"
- if [ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ];
then
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push "$DOCKER_REPO:$TAG";
docker push "$DOCKER_REPO-alpine:$TAG";
fi

after_failure:
- id
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM scratch

MAINTAINER Vidar Holen <[email protected]>
LABEL maintainer="Vidar Holen <[email protected]>"

# This file assumes ShellCheck has already been built.
# See https://github.com/koalaman/scbuilder
COPY shellcheck /
COPY shellcheck /bin

WORKDIR /mnt
ENTRYPOINT ["/shellcheck"]
ENTRYPOINT ["/bin/shellcheck"]
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ While ShellCheck is mostly intended for interactive use, it can easily be added

ShellCheck makes canonical use of exit codes, and can output simple JSON, CheckStyle compatible XML, GCC compatible warnings as well as human readable text (with or without ANSI colors). See the [Integration](https://github.com/koalaman/shellcheck/wiki/Integration) wiki page for more documentation.

## Travis CI Setup

If you want to use ShellCheck in Travis CI, setting it up is simple :tada:.

```yml
language: bash
addons:
apt:
sources:
- debian-sid # Grab ShellCheck from the Debian repo
packages:
- shellcheck
```
## Installing

The easiest way to install ShellCheck locally is through your package manager.
Expand Down Expand Up @@ -136,13 +122,30 @@ From Docker Hub:
docker pull koalaman/shellcheck:latest # Or :v0.4.6 for a release version
docker run -v "$PWD:/mnt" koalaman/shellcheck myscript

Alternatively, get freshly built binaries here:
or use `koalaman/shellcheck-alpine` if you want a larger Alpine Linux based image to extend.

Alternatively, get freshly built binaries for the latest commit here:

* [Linux, x86_64](https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz) (statically linked)
* [Windows, x86](https://storage.googleapis.com/shellcheck/shellcheck-latest.zip)

or see the [storage bucket listing](https://shellcheck.storage.googleapis.com/index.html) for checksums and release builds.

## Travis CI Setup

If you want to use ShellCheck in Travis CI, you can most easily install it via `apt`:

```yml
language: bash
addons:
apt:
sources:
- debian-sid # Grab ShellCheck from the Debian repo
packages:
- shellcheck
```
## Compiling from source
This section describes how to build ShellCheck from a source directory. ShellCheck is written in Haskell and requires 2GB of RAM to compile.
Expand Down

0 comments on commit f73736e

Please sign in to comment.