Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
knqyf263 committed Oct 28, 2023
1 parent 2c91613 commit db3f8fb
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,55 @@

1. Install Go.

The project requires [Go 1.17][go-download] or later. We also assume that you're familiar with
The project requires [Go 1.21][go-download] or later. We also assume that you're familiar with
Go's [GOPATH workspace][go-code] convention, and have the appropriate environment variables set.
2. Install Docker, Docker Compose, and Make.
2. Install Docker, Make, and Skaffold.
3. Get the source code.
```
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git
cd harbor-scanner-trivy
```

## Setup Development Environment with Vagrant
## Set up Development Environment with Kubernetes

1. Get the source code.
```
git clone https://github.com/aquasecurity/harbor-scanner-trivy.git
git clone --recursive https://github.com/aquasecurity/harbor-scanner-trivy.git
cd harbor-scanner-trivy
```
2. Create and configure a guest development machine, which is based on Ubuntu 20.4 LTS and has Go, Docker, Docker Compose,
Make, and Harbor v2.5.1 preinstalled. Harbor is installed in the `/opt/harbor` directory.
2. Launch a Kubernetes cluster

We recommend setting up a Kubernetes cluster with:

- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/)
- [minikube](https://minikube.sigs.k8s.io/docs/start/)
- [Docker Desktop](https://docs.docker.com/desktop/)
- [Rancher Desktop](https://docs.rancherdesktop.io/ui/preferences/kubernetes/)

However, you can use any Kubernetes cluster you want.

In case of kind, you can use the following command to create a cluster:
```
vagrant up
kind create cluster --name harbor-scanner-trivy
```
If everything goes well Harbor will be accessible at http://localhost:8181 (admin/Harbor12345).

To SSH into a running Vagrant machine.
3. Run Skaffold

The following command will build the image and deploy Harbor with the scanner adapter to the Kubernetes cluster:
```
vagrant ssh
make dev
```
The `/vagrant` directory in the development machine is shared between host and guest. This, for example, allows you
to rebuild a container image for testing.

4. Access Harbor UI

After the Harbor chart is deployed, you can access `https://core.harbor.domain`.
It depends on how you configure the Kubernetes cluster, but you may need to add a host entry to `/etc/hosts` file.

```
vagrant@ubuntu-focal:/vagrant$ make docker-build
echo "127.0.0.1\tcore.harbor.domain" | sudo tee -a /etc/hosts
```

username: admin, password: Harbor12345

## Build Binaries

Expand Down

0 comments on commit db3f8fb

Please sign in to comment.