Skip to content

Commit 5606540

Browse files
authored
Merge pull request #59 from CreMindES/feature/docker-image
Feature/docker image
2 parents 0b4d823 + 969ad7b commit 5606540

File tree

14 files changed

+95
-11
lines changed

14 files changed

+95
-11
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugins/*

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
77
Dockerfile linter written in Go.
88

9+
It provides static analysis for Dockerfiles, identifying common mistakes and promotes best practices.
10+
911
<p align="center">
1012
<img width="500px" src="docs/illustration/illustration.svg"/>
1113
</p>
@@ -35,14 +37,15 @@ Each Dockerfile AST element has a corresponding set of rules. Click on the pictu
3537
| Configurable Output | | ![Done](https://img.shields.io/static/v1?label=&message=Done&color=Green)
3638
| - JSON | ![Done](https://img.shields.io/static/v1?label=&message=Done&color=Green) |
3739
| - Colored Summary | ![Done](https://img.shields.io/static/v1?label=&message=Done&color=Green) |
40+
| Docker image | | ![Done](https://img.shields.io/static/v1?label=&message=Done&color=Green) |
3841
| Rule pass | | ![NotYetStarted](https://img.shields.io/static/v1?label=&message=NoYetStarted&color=lightgrey) |
3942
| - Per line | ![NotYetStarted](https://img.shields.io/static/v1?label=&message=NoYetStarted&color=lightgrey) |
4043
| - Config file | ![NotYetStarted](https://img.shields.io/static/v1?label=&message=NoYetStarted&color=lightgrey) |
4144
| Config file | | ![NotYetStarted](https://img.shields.io/static/v1?label=&message=NoYetStarted&color=lightgrey) |
4245
| - Rule profiles | ![NotYetStarted](https://img.shields.io/static/v1?label=&message=NoYetStarted&color=lightgrey) |
4346
| IDE plugins/extensions | | ![InProgress](https://img.shields.io/static/v1?label=&message=InProgress&color=blue)
44-
| - VSCode | ![Preview](https://img.shields.io/static/v1?label=&message=Preview&color=blue)
45-
| - JetBrains | ![InProgress](https://img.shields.io/static/v1?label=&message=InProgress&color=blue)
47+
| - VSCode | ![PreviewRelease](https://img.shields.io/static/v1?label=&message=PreviewRelease&color=blue)
48+
| - JetBrains | ![PreviewRelease](https://img.shields.io/static/v1?label=&message=PreviewRelease&color=blue)
4649

4750
### Design Decisions
4851

@@ -52,6 +55,17 @@ A collection of documents describing the thought process behind selected design
5255

5356
[Link > TODO](docs/contribution/readme.md)
5457

58+
## Docker Image
59+
60+
![Docker imaage version](https://img.shields.io/docker/v/cremindes/whalelint)
61+
![DockerHub Downloads](https://img.shields.io/docker/pulls/cremindes/whalelint)
62+
![Docker image size](https://img.shields.io/docker/image-size/cremindes/whalelint)
63+
64+
```bash
65+
docker pull cremindes/whalelint:[tag]
66+
docker run --rm -v $(pwd)/Dockerfile:/Dockerfile cremindes/whalelint:[tag] Dockerfile
67+
```
68+
5569
## Plugins
5670

5771
### JetBrains
@@ -63,7 +77,7 @@ A collection of documents describing the thought process behind selected design
6377
<img src="https://user-images.githubusercontent.com/5306361/110693878-3a926300-81e8-11eb-80c4-7041f2ecf675.gif"/>
6478
</p>
6579

66-
*Note: make sure, to also install the [Docker plugin](https://plugins.jetbrains.com/plugin/7724-docker).
80+
*Note: make sure, to also install the [Docker plugin](https://plugins.jetbrains.com/plugin/7724-docker) in case it's not bundled with the IDE.
6781

6882
### VSCode
6983

cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (lspCommand *LspCommand) Run() error {
140140
type VersionCommand struct{}
141141

142142
func (versionCommand *VersionCommand) Run(k *kong.Context) error {
143-
version := "v0.0.6"
143+
version := "v0.0.7"
144144
k.Printf("%s", version)
145145

146146
return nil

cli/cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func TestVersionCommand_Run(t *testing.T) {
6767
err = ctx.Run()
6868
assert.NilError(t, err)
6969

70-
assert.Equal(t, "whalelint: v0.0.6\n", stdBuffer.stdOut.String())
70+
assert.Equal(t, "whalelint: v0.0.7\n", stdBuffer.stdOut.String())
7171
assert.Equal(t, "", stdBuffer.stdErr.String())
7272
}
7373

docker/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM golang:1.15 as goBuilder
2+
3+
COPY . /go/src/github.com/CreMindES/whalelint/
4+
5+
WORKDIR /go/src/github.com/CreMindES/whalelint/
6+
RUN CGO_ENABLED=0 go build -o /app/whalelint
7+
8+
FROM hairyhenderson/upx:3.96 as upxBuilder
9+
10+
WORKDIR /app
11+
COPY --from=goBuilder /app/whalelint /app/whalelint
12+
RUN upx whalelint
13+
14+
FROM scratch
15+
16+
ARG gitCommitHash
17+
18+
LABEL maintainer="Tamas Gabor Barna"
19+
LABEL source="https://github.com/CreMindES/whalelint"
20+
LABEL description="Dockerfile linter."
21+
LABEL revision=${gitCommitHash}
22+
23+
COPY --from=upxBuilder /app/whalelint /usr/local/bin/
24+
25+
CMD ["--help"]
26+
ENTRYPOINT ["/usr/local/bin/whalelint"]

docker/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
docker build \
4+
-f plugins/dockerhub/Dockerfile \
5+
--no-cache \
6+
--build-arg gitCommitHash=$(git rev-parse HEAD) \
7+
-t cremindes/whalelint:latest \
8+
.
9+

docker/readme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# <img width="22px" src="https://user-images.githubusercontent.com/5306361/110181582-6c807f80-7e0c-11eb-81c8-36d6a9c0db0b.png"> WhaleLint <img align="right" style="position: relative; top: 10px;" src="https://github.com/cremindes/whalelint/workflows/build/badge.svg" />
2+
3+
Dockerfile linter written in Go.
4+
5+
It provides static analysis for Dockerfiles, identifying common mistakes and promotes best practices.
6+
7+
<p align="center">
8+
<img width="500px" src="https://user-images.githubusercontent.com/5306361/110991142-870aa980-8374-11eb-8855-9f3ce400049e.png"/>
9+
</p>
10+
11+
## Usage
12+
13+
```bash
14+
docker pull cremindes/whalelint:[tag]
15+
docker run --rm -v $(pwd)/Dockerfile:/Dockerfile cremindes/whalelint:[tag] Dockerfile
16+
```
17+
18+
## Sample output
19+
20+
<p align="center">
21+
<img width="750px" src="https://user-images.githubusercontent.com/5306361/110198673-775f0280-7e54-11eb-8e4e-ab6350fb4e7d.png"/>
22+
</p>
23+
24+
## GitHub
25+
26+
[Official repository](https://github.com/CreMindES/whalelint) with further information.

docs/illustration/illustration.svg

Lines changed: 1 addition & 1 deletion
Loading

illustration.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

plugins/jetbrains/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "WhaleLint"
12-
version = "0.0.6"
12+
version = "0.0.7"
1313

1414
description = "WhaleLint is a Dockerfile linter written in Golang."
1515

@@ -58,7 +58,7 @@ tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml
5858
"<h2>Introduction</h2>", ""))
5959
}
6060

61-
version("0.0.6")
61+
version("0.0.7")
6262
}
6363

6464
tasks.withType<JavaCompile> {

0 commit comments

Comments
 (0)