1
0
mirror of https://github.com/mgechev/revive.git synced 2025-07-15 01:04:40 +02:00

Add Docker image in release (#489) (#590)

This commit is contained in:
doniacld
2021-10-15 08:36:14 +02:00
committed by GitHub
parent be81121399
commit c0f2d40eaa
4 changed files with 28 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ golinter
revive
vendor
*.swp
dist/

View File

@ -22,6 +22,18 @@ builds:
- darwin
- windows
dockers:
- image_templates: ["ghcr.io/mgechev/revive:{{ .Version }}"]
dockerfile: Dockerfile
build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/mgechev/revive
- --label=org.opencontainers.image.source=https://github.com/mgechev/revive
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
changelog:
filters:
exclude:

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM scratch
COPY revive /usr/bin/revive
ENTRYPOINT ["/usr/bin/revive"]

View File

@ -119,6 +119,18 @@ Since the default behavior of `revive` is compatible with `golint`, without prov
`revive` supports a `-config` flag whose value should correspond to a TOML file describing which rules to use for `revive`'s linting. If not provided, `revive` will try to use a global config file (assumed to be located at `$HOME/revive.toml`). Otherwise, if no configuration TOML file is found then `revive` uses a built-in set of default linting rules.
### Docker
A volume needs to be mounted to share the current repository with the container.
Please refer to the [bind mounts Docker documentation](https://docs.docker.com/storage/bind-mounts/)
```bash
docker run -v "$(pwd)":/var/<repository> ghcr.io/mgechev/revive:v1.1.2-next -config /var/<repository>/revive.toml -formatter stylish ./var/kidle/...
```
- `-v` is for the volume
- `ghcr.io/mgechev/revive:v1.1.2-next ` is the image name and its version corresponding to `revive` command
- The provided flags are the same as the binary usage.
### Bazel
If you want to use revive with Bazel, take a look at the [rules](https://github.com/atlassian/bazel-tools/tree/master/gorevive) that Atlassian maintains.