Skip to content

Commit

Permalink
fix: build without CGO
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugome committed Oct 16, 2020
1 parent e14aa3c commit 2e449b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apk update && \
COPY . .

RUN go mod download
RUN GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /app
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o /app

FROM scratch

Expand All @@ -31,4 +31,4 @@ ENTRYPOINT ["/app"]
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /etc/group /etc/group
COPY --from=build /app /app
COPY --from=build /app /app
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ spec:
protocol: TCP
name: metrics
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
capabilities:
drop:
- ALL
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
```
Expand All @@ -87,7 +87,6 @@ kind: ServiceMonitor
apiVersion: monitoring.coreos.com/v1
metadata:
name: freshping-exporter
namespace: monitor
labels:
app.kubernetes.io/name: freshping-exporter
spec:
Expand Down

0 comments on commit 2e449b0

Please sign in to comment.