Alternative Alpine based docker image for ansible-lint
Running ansible-lint in your current directory.
docker run --rm -v "${PWD}":/ansible ghcr.io/bkram/docker-ansible-lint:latest --force-color
In order of detection the possibilites are:
docker run --rm -v "$PWD"/ansible-lint.yml:/ansible-lint.yml -v "${PWD}":/ansible ghcr.io/bkram/docker-ansible-lint:latest --force-color
The files are detected in this order :
- .ansible-lint
- .config/ansible-lint.yml
Building the provided Dockerfile
docker build Docker -t bkram/docker-ansible-lint
Running ansible-lint in your current directory.
docker run --rm -v "${PWD}":/ansible bkram/docker-ansible-lint --force-color
In your repository with ansible code create a file called .github/workflows/ansible-lint.yml
---
name: ansible-lint
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ansible-lint docker
run: docker run -v $GITHUB_WORKSPACE:/ansible ghcr.io/bkram/docker-ansible-lint:latest --force-color