Skip to content

Commit

Permalink
Add hadolint (Haskell Dockerfile Linter)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ishigaki committed May 7, 2022
1 parent 7b66271 commit eea7a52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
"atsushieno.language-review",
"taichi.vscode-textlint",
"James-Yu.latex-workshop",
"exiasr.hadolint"
],
}
14 changes: 10 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ x-common-options: &common-options
review-update@review
npm@node
npx@node
hadolint --no-color@hadolint
'
for container_command in `echo $$container_commands | tr -s ' ' '\n'`; do
command_name=`echo $$container_command | cut -d '@' -f 1`
service_name=`echo $$container_command | cut -d '@' -f 2`
echo "$$container_commands" | while read -r container_command; do
command=`echo "$$container_command" | cut -d '@' -f 1`
command_name=`echo "$$command" | cut -d ' ' -f 1`
service_name=`echo "$$container_command" | cut -d '@' -f 2`
if command -v $$command_name; then continue; fi
{ \
echo '#!/bin/sh -e'; \
echo 'if [ -t 1 ]; then tty_option=-t; fi'; \
echo 'exec docker exec -i $$tty_option -w $$PWD '"${COMPOSE_PROJECT_NAME}_$${service_name}_1 $${command_name}"' "$$@"'; \
echo 'exec docker exec -i $$tty_option -w $$PWD '"${COMPOSE_PROJECT_NAME}_$${service_name}_1 $${command}"' "$$@"'; \
} | sudo tee /usr/local/bin/$$command_name
sudo chmod +x /usr/local/bin/$$command_name
done
Expand Down Expand Up @@ -102,3 +104,7 @@ services:
neovim:
image: ghcr.io/k-ishigaki/neovim-docker:1
<<: *common-options

hadolint:
image: ghcr.io/k-ishigaki/hadolint-docker:1
<<: *common-options

0 comments on commit eea7a52

Please sign in to comment.