-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): add Dockerfile for container build
- Loading branch information
1 parent
0b533f7
commit 3767fe4
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM golang:alpine AS build | ||
|
||
WORKDIR /app | ||
RUN apk add --no-cache make | ||
|
||
# Install dependencies. | ||
COPY go.* ./ | ||
RUN go mod download | ||
|
||
# Copy source files and build application. | ||
COPY . /app | ||
ARG VERSION | ||
RUN VERSION=${VERSION} make -B && mv bin/* /app/bin/netadm | ||
|
||
# Create minimal container image. | ||
FROM alpine AS run | ||
COPY --from=build /app/bin/netadm /netadm | ||
CMD [ "/netadm" ] |