Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github/
Dockerfile
justfile
LICENSE
README.md
40 changes: 40 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: 'Docker'
'on':
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
schedule:
- cron: "0 1 * * 0" # Run every Sunday at 1:00 UTC
defaults:
run:
shell: 'bash'
env:
IMAGE_NAME: 'ghcr.io/dsiebel/shellcheck-docker:latest'
jobs:
build:
runs-on: 'ubuntu-latest'
steps:

- name: 'Set up Docker Buildx'
uses: 'docker/setup-buildx-action@v3'

- name: 'Build'
uses: 'docker/build-push-action@v6'
with:
push: "${{ github.event_name != 'pull_request' }}"
load: "${{ github.event_name == 'pull_request' }}"
tags: "${{ env.IMAGE_NAME}}"

- name: 'Test'
run: |
docker run --rm --entrypoint shellcheck "${{ env.IMAGE_NAME}}" --version

docker run --rm \
--workdir /usr/local/bin \
--env VERBOSE=1 \
"${{ env.IMAGE_NAME}}" \
--include shellcheckw
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ FROM debian:bookworm-slim
WORKDIR /usr/src/shellcheck

RUN apt-get update \
&& apt-get upgrade --yes \
&& apt-get install --yes --no-install-recommends \
shellcheck \
file
file \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY shellcheckw /usr/local/bin/shellcheckw

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@

`debian:bookworm-slim` based Docker image, wrapping [Shellcheck](https://www.shellcheck.net/)
with some file include / exclude magic.

## Usage

```bash
docker run --rm --volume $(pwd):/mnt --workdir /mnt \
ghcr.io/dsiebel/shellcheck-docker:latest
--include-file shellcheck.txt
```
3 changes: 3 additions & 0 deletions shellcheckw
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env bash
[[ -v VERBOSE ]] && set -x

#shellcheck enable=check-set-e-suppressed
set -eu
shopt -s inherit_errexit

excludes=()
includes=()
Expand Down
Loading