Skip to content

Commit

Permalink
Replace hadolint with Trivy (#734)
Browse files Browse the repository at this point in the history
* Replace hadolint with Trivy

* Fix wrong commit
  • Loading branch information
kachick authored Mar 23, 2024
1 parent 2a43f89 commit 293f10a
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 63 deletions.
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ COPY ["./.devcontainer/setup_direnv.bash", "./"]
RUN ./setup_direnv.bash

# Clean up to avoid confusion
# hadolint ignore=DL3059
RUN rm ./flake.nix ./setup_direnv.bash

# `ENTRYPOINT` and `CMD` will be ignored in .devcontainer. Use postCreateCommand instead
Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ Just get from Nix shell as follows.
```console
> which dprint
/nix/store/2rmr7ybmnr5xdcy6sw1073p0j5ljgw0n-dprint-0.37.1/bin/dprint
> which hadolint
/nix/store/3gl6j30ak4n692vfs5l1rsqf07pdr429-hadolint-2.12.0/bin/hadolint
```

I want to realize better integration, but I don't know it.
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"settings": {
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true,
"hadolint.hadolintPath": "/nix/store/3gl6j30ak4n692vfs5l1rsqf07pdr429-hadolint-2.12.0/bin/hadolint",
"dprint.path": "/nix/store/2rmr7ybmnr5xdcy6sw1073p0j5ljgw0n-dprint-0.37.1/bin/dprint",
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
Expand All @@ -33,7 +32,6 @@
"dprint.dprint",
"jnoortheen.nix-ide",
"tamasfe.even-better-toml",
"exiasr.hadolint",
"ms-azuretools.vscode-docker"
]
}
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/hadolint.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AVD-DS-0017

AVD-DS-0026
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"tekumara.typos-vscode",
"jnoortheen.nix-ide",
"tamasfe.even-better-toml",
"exiasr.hadolint",
"ms-azuretools.vscode-docker"
]
}
4 changes: 2 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ script = [
"deno lint",
"typos . .github .vscode .devcontainer",
"actionlint",
"hadolint .devcontainer/Dockerfile",
"trivy config --exit-code 1 .",
]

[tasks.test]
Expand Down Expand Up @@ -86,7 +86,7 @@ script = [
# Returns NON 0, why...? :<
# "nixpkgs-fmt --version",
"actionlint --version",
"hadolint --version",
"trivy --version",
"typos --version",
]

Expand Down
27 changes: 5 additions & 22 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@
# - https://discourse.nixos.org/t/differences-between-nix-channels/13998
# How to update the revision
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-23.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs-unstable, nixpkgs-stable, flake-utils }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
unstable-pkgs = nixpkgs-unstable.legacyPackages.${system};
stable-pkgs = nixpkgs-stable.legacyPackages.${system};
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = with unstable-pkgs;
devShells.default = with pkgs;
mkShell {
buildInputs = [
# https://github.com/NixOS/nix/issues/730#issuecomment-162323824
Expand All @@ -35,9 +33,7 @@
gh
jq

# Avoided broken hadolint in latest
# https://github.com/NixOS/nixpkgs/pull/240387#issuecomment-1686601267
stable-pkgs.hadolint
trivy
];
};
});
Expand Down

0 comments on commit 293f10a

Please sign in to comment.