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
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.github
.gitignore
*.md
testFiles
frontend
guides
docs
layerlint
*.tar.gz
*.zip
.DS_Store
node_modules
35 changes: 35 additions & 0 deletions .github/workflows/layerlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: LayerLint Scan

on:
pull_request:
paths:
- 'Dockerfile'
- '**.go'
- '.github/workflows/layerlint.yml'
push:
branches:
- main
paths:
- 'Dockerfile'
- '**.go'
- '.github/workflows/layerlint.yml'

jobs:
lint-dockerfiles:
runs-on: ubuntu-latest
name: Scan Dockerfiles with LayerLint

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.3'

- name: Build LayerLint
run: go build -o layerlint ./cmd/layerlint

- name: Scan Dockerfile
run: ./layerlint scan --dockerfile ./Dockerfile --fail-on-severity medium
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ WORKDIR /app
COPY go.mod ./
COPY . .

RUN go build -o layerlint ./cmd/layerlint
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -o layerlint ./cmd/layerlint

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser

ENTRYPOINT ["/app/layerlint"]
2 changes: 1 addition & 1 deletion internal/report/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ParseFormat(s string) (Format, error) {

func PrintText(findings []models.Finding) {
if len(findings) == 0 {
fmt.Println("LayerLint found no cache issues")
fmt.Println("LayerLint found no issues")
return
}

Expand Down
2 changes: 1 addition & 1 deletion internal/scan/results.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func PrintText(findings []models.Finding) {
if len(findings) == 0 {
fmt.Println("LayerLint found no cache issues")
fmt.Println("LayerLint found no issues")
return
}

Expand Down
Loading