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

Add Dockerfile to build dockerfile-add-scaned as docker image #3487

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]