-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "fix: allow the project to complete the build in the docker"
- Loading branch information
Showing
1 changed file
with
4 additions
and
14 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 |
---|---|---|
@@ -1,20 +1,10 @@ | ||
FROM alpine:3.15.0 as certs | ||
RUN apk --update add ca-certificates | ||
|
||
FROM golang:1.18.0-alpine3.15 AS builder | ||
RUN apk add git bash gcc musl-dev upx | ||
WORKDIR /app | ||
COPY . . | ||
RUN go mod tidy | ||
RUN go test -v ./... | ||
ENV CGO_ENABLED=0 | ||
RUN GOARCH=amd64 go build -ldflags "-w -s" -v ./... | ||
RUN upx -9 -o grimd.minify grimd && mv grimd.minify grimd | ||
|
||
FROM scratch | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /app/grimd /usr/bin/grimd | ||
EXPOSE 53:53/udp | ||
EXPOSE 53:53/tcp | ||
EXPOSE 8080 | ||
COPY grimd /usr/bin/grimd | ||
EXPOSE 53/udp | ||
EXPOSE 53/tcp | ||
EXPOSE 8080/tcp | ||
ENTRYPOINT ["/usr/bin/grimd"] |