Skip to content

Commit

Permalink
Add Dockerfile to build dockerfile-add-scaned as docker image
Browse files Browse the repository at this point in the history
We need this to to run in eve-kernel repo to generate spdx.json file

Signed-off-by: Mikhail Malyshev <[email protected]>
  • Loading branch information
mikem-zed committed Oct 11, 2023
1 parent e1538b5 commit 48cf7ea
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use an official Golang runtime as a parent image
FROM golang:1.20.1 as builder

# Set the working directory to /go/src/app
WORKDIR /go/src/app

# Copy the current directory contents into the container at /go/src/app
COPY /dockerfile-add-scanner /go/src/app

# Install any needed dependencies
RUN go get -d -v ./...

# Compile the application
RUN GOOS=linux CGO_ENABLED=0 go build -o /bin/dockerfile-add-scanner

# Deploy the application binary into a lean image
FROM scratch

WORKDIR /bin
COPY --from=builder /bin/dockerfile-add-scanner /bin/dockerfile-add-scanner

CMD ["/bin/dockerfile-add-scanner"]

0 comments on commit 48cf7ea

Please sign in to comment.