docs: add asdf and mise installation method (#6063)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Jean-Yves LENHOF
2024-04-30 09:32:14 +02:00
committed by GitHub
parent 29b8faf5fa
commit a5d485cf8a

View File

@@ -85,11 +85,9 @@ References:
Nix package manager for Linux and MacOS. Nix package manager for Linux and MacOS.
=== "Command line" === "Command line"
`nix-env --install -A nixpkgs.trivy` `nix-env --install -A nixpkgs.trivy`
=== "Configuration" === "Configuration"
```nix ```nix
# your other config ... # your other config ...
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@@ -99,7 +97,6 @@ Nix package manager for Linux and MacOS.
``` ```
=== "Home Manager" === "Home Manager"
```nix ```nix
# your other config ... # your other config ...
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -109,7 +106,8 @@ Nix package manager for Linux and MacOS.
``` ```
References: References:
- <https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/trivy/default.nix>
- https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/admin/trivy/default.nix
### FreeBSD (Official) ### FreeBSD (Official)
@@ -119,6 +117,48 @@ References:
pkg install trivy pkg install trivy
``` ```
### asdf/mise (Community)
[asdf](https://github.com/asdf-vm/asdf) and [mise](https://github.com/jdx/mise) are quite similar tools you can use to install trivy.
See their respective documentation for more information of how to install them and use them:
- [asdf](https://asdf-vm.com/guide/getting-started.html)
- [mise](https://mise.jdx.dev/getting-started.html)
The plugin used by both tools is developped [here](https://github.com/zufardhiyaulhaq/asdf-trivy)
=== "asdf"
A basic global installation is shown below, for specific version or/and local version to a directory see "asdf" documentation.
```shell
# Install plugin
asdf plugin add trivy https://github.com/zufardhiyaulhaq/asdf-trivy.git
# Install latest version
asdf install trivy latest
# Set a version globally (on your ~/.tool-versions file)
asdf global trivy latest
# Now trivy commands are available
trivy --version
```
=== "mise"
A basic global installation is shown below, for specific version or/and local version to a directory see "mise" documentation.
``` shell
# Install plugin and install latest version
mise install trivy@latest
# Set a version globally (on your ~/.tool-versions file)
mise use -g trivy@latest
# Now trivy commands are available
trivy --version
```
## Install from GitHub Release (Official) ## Install from GitHub Release (Official)
### Download Binary ### Download Binary