Add Alpine-based docker image

This commit is contained in:
Vidar Holen 2017-10-07 13:18:59 -07:00
parent 3785a08906
commit f73736e5c9
3 changed files with 30 additions and 21 deletions

View File

@ -24,12 +24,18 @@ script:
- rm -rf dist || true - rm -rf dist || true
# Linux Docker image # Linux Docker image
- docker build -t "$DOCKER_REPO:$TAG" . - 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: after_success:
- ./.prepare_deploy - ./.prepare_deploy
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - if [ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ];
- |- then
([ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ]) && docker push "$DOCKER_REPO:$TAG" 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: after_failure:
- id - id

View File

@ -1,10 +1,10 @@
FROM scratch FROM scratch
MAINTAINER Vidar Holen <vidar@vidarholen.net> LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
# This file assumes ShellCheck has already been built. # This file assumes ShellCheck has already been built.
# See https://github.com/koalaman/scbuilder # See https://github.com/koalaman/scbuilder
COPY shellcheck / COPY shellcheck /bin
WORKDIR /mnt WORKDIR /mnt
ENTRYPOINT ["/shellcheck"] ENTRYPOINT ["/bin/shellcheck"]

View File

@ -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. 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 ## Installing
The easiest way to install ShellCheck locally is through your package manager. The easiest way to install ShellCheck locally is through your package manager.
@ -136,13 +122,30 @@ From Docker Hub:
docker pull koalaman/shellcheck:latest # Or :v0.4.6 for a release version docker pull koalaman/shellcheck:latest # Or :v0.4.6 for a release version
docker run -v "$PWD:/mnt" koalaman/shellcheck myscript 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) * [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) * [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. 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 ## 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. This section describes how to build ShellCheck from a source directory. ShellCheck is written in Haskell and requires 2GB of RAM to compile.