-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 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,23 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
FROM golang:1.20.5-bullseye AS build | ||
|
||
WORKDIR /opt | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
COPY main.go . | ||
|
||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod go build -o app | ||
|
||
FROM busybox:1.35.0-glibc | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build /opt / | ||
|
||
EXPOSE 53 | ||
EXPOSE 2379 | ||
|
||
ENTRYPOINT ["/app"] |
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,14 @@ | ||
.PHONY: lint | ||
lint: | ||
golangci-lint run -v | ||
|
||
build: | ||
go build | ||
|
||
COMMIT_ID := $(shell git rev-parse --short HEAD) | ||
|
||
img_repo ?= local | ||
|
||
.PHONY: docker | ||
docker: | ||
docker build -t $(img_repo):$(COMMIT_ID) . |
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