mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 18:09:55 +00:00
add docker build
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
*.vs*
|
*.vs*
|
||||||
*go.sum*
|
*go.sum*
|
||||||
*kubescape*
|
*kubescape*
|
||||||
*debug*
|
*debug*
|
||||||
|
.idea
|
||||||
12
README.md
12
README.md
@@ -126,6 +126,18 @@ go mod tidy && go build -o kubescape .
|
|||||||
|
|
||||||
4. Enjoy :zany_face:
|
4. Enjoy :zany_face:
|
||||||
|
|
||||||
|
# How to build in Docker
|
||||||
|
|
||||||
|
1. Clone Project
|
||||||
|
```
|
||||||
|
git clone git@github.com:armosec/kubescape.git kubescape && cd "$_"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Build
|
||||||
|
```
|
||||||
|
docker build -t kubescape -f build/Dockerfile .
|
||||||
|
```
|
||||||
|
|
||||||
# Under the hood
|
# Under the hood
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|||||||
13
build/Dockerfile
Normal file
13
build/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM golang:1.16-alpine as builder
|
||||||
|
ENV GOPROXY=https://goproxy.io,direct
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
|
||||||
|
WORKDIR /work
|
||||||
|
ADD . .
|
||||||
|
RUN go mod download
|
||||||
|
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w " -installsuffix cgo -o kubescape .
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
COPY --from=builder /work/kubescape /usr/bin/kubescape
|
||||||
|
|
||||||
|
CMD ["kubescape"]
|
||||||
Reference in New Issue
Block a user