Skip to content

Commit c7c7e44

Browse files
authored
updated the fixes (#1)
Signed-off-by: vviveksharma <visharma@progress.com>
1 parent 67d86c5 commit c7c7e44

5 files changed

Lines changed: 56 additions & 3 deletions

File tree

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git
2+
.github
3+
.gitignore
4+
*.md
5+
testFiles
6+
frontend
7+
guides
8+
docs
9+
layerlint
10+
*.tar.gz
11+
*.zip
12+
.DS_Store
13+
node_modules

.github/workflows/layerlint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: LayerLint Scan
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'Dockerfile'
7+
- '**.go'
8+
- '.github/workflows/layerlint.yml'
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- 'Dockerfile'
14+
- '**.go'
15+
- '.github/workflows/layerlint.yml'
16+
17+
jobs:
18+
lint-dockerfiles:
19+
runs-on: ubuntu-latest
20+
name: Scan Dockerfiles with LayerLint
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '1.26.3'
30+
31+
- name: Build LayerLint
32+
run: go build -o layerlint ./cmd/layerlint
33+
34+
- name: Scan Dockerfile
35+
run: ./layerlint scan --dockerfile ./Dockerfile --fail-on-severity medium

Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ WORKDIR /app
55
COPY go.mod ./
66
COPY . .
77

8-
RUN go build -o layerlint ./cmd/layerlint
8+
RUN --mount=type=cache,target=/go/pkg/mod \
9+
--mount=type=cache,target=/root/.cache/go-build \
10+
go build -o layerlint ./cmd/layerlint
11+
12+
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
13+
USER appuser
914

1015
ENTRYPOINT ["/app/layerlint"]

internal/report/formatter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func ParseFormat(s string) (Format, error) {
4949

5050
func PrintText(findings []models.Finding) {
5151
if len(findings) == 0 {
52-
fmt.Println("LayerLint found no cache issues")
52+
fmt.Println("LayerLint found no issues")
5353
return
5454
}
5555

internal/scan/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func PrintText(findings []models.Finding) {
1111
if len(findings) == 0 {
12-
fmt.Println("LayerLint found no cache issues")
12+
fmt.Println("LayerLint found no issues")
1313
return
1414
}
1515

0 commit comments

Comments
 (0)