Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building as standalone gives issues regarding version #81

Open
wing-cheng opened this issue Nov 15, 2022 · 6 comments
Open

Building as standalone gives issues regarding version #81

wing-cheng opened this issue Nov 15, 2022 · 6 comments
Assignees

Comments

@wing-cheng
Copy link

$ go get github.com/deepfence/SecretScanner go: downloading github.com/deepfence/SecretScanner v1.1.2 go: github.com/deepfence/SecretScanner upgrade => v1.1.2 go get: github.com/deepfence/[email protected] requires github.com/deepfence/[email protected]: invalid version: unknown revision 000000000000

What is the problem here? May I have the latest updated the documentation or can you fix the go.mod file?

@wing-cheng wing-cheng changed the title Building as standalone gives dependency issue Building as standalone gives dependency issues Nov 15, 2022
@ramanan-ravi
Copy link
Contributor

Hello @wing-cheng ,

The recommended way to build is the following

./bootstrap.sh
docker build --rm=true --tag=deepfenceio/deepfence_secret_scanner:latest -f Dockerfile .

If you would like to build outside of docker, please follow these steps:

./bootstrap.sh
# Install dependencies: https://github.com/deepfence/SecretScanner/blob/master/Dockerfile#L4-L12
# Build: https://github.com/deepfence/SecretScanner/blob/master/Dockerfile#L16-L17

If the base OS is not alpine, equivalent dependencies in the target OS needs to be installed.

@wing-cheng
Copy link
Author

Hello, can u explain these 2 sentence? They dont quite make sense to me.
I just wanna build it as standalone with Go.

# Install dependencies: https://github.com/deepfence/SecretScanner/blob/master/Dockerfile#L4-L12
# Build: https://github.com/deepfence/SecretScanner/blob/master/Dockerfile#L16-L17

@ramanan-ravi
Copy link
Contributor

ramanan-ravi commented Nov 15, 2022

Some of the dependent golang libraries has system dependencies, so they need to be installed.

After that you can build by running these commands (from here)

make clean && make

@wing-cheng wing-cheng changed the title Building as standalone gives dependency issues Building as standalone gives issues regarding version Nov 16, 2022
@wing-cheng
Copy link
Author

wing-cheng commented Nov 16, 2022

Hey still getting the same error, the make file still runs go build -i -v

$ go build -i -v go: downloading github.com/deepfence/SecretScanner v1.1.2 go: github.com/deepfence/SecretScanner upgrade => v1.1.2 go get: github.com/deepfence/[email protected] requires github.com/deepfence/[email protected]: invalid version: unknown revision 000000000000

@ramanan-ravi
Copy link
Contributor

ramanan-ravi commented Nov 16, 2022

Hi, you have to run ./bootstrap.sh first.

./bootstrap.sh
# install dependencies
make clean && make

@wing-cheng
Copy link
Author

wing-cheng commented Nov 16, 2022

I did, but got more errors

$ ./bootstrap.sh
$ make clean
(cd agent-plugins-grpc && make clean)
make[1]: Entering directory 'C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc'
rm -rf ./proto/*.go
make[1]: Leaving directory 'C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc'
rm ./SecretScanner
rm: cannot remove './SecretScanner': No such file or directory
Makefile:10: recipe for target 'clean' failed
make: [clean] Error 1 (ignored)
$ make
(cd agent-plugins-grpc && make go)
make[1]: Entering directory 'C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc'
protoc --go_out=proto --go_opt=paths=source_relative \
    --go-grpc_out=proto --go-grpc_opt=paths=source_relative \
--proto_path=proto \
    proto/*.proto
/usr/bin/sh: line 1: protoc: command not found
Makefile:2: recipe for target 'go' failed
make[1]: *** [go] Error 127
make[1]: Leaving directory 'C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc'
Makefile:7: recipe for target 'C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc/proto/*.go' failed
make: *** [C:/Users/xxx/Documents/SecretScanner/agent-plugins-grpc/proto/*.go] Error 2

@saurabh2253 saurabh2253 self-assigned this Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants