-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM golang:alpine AS builder
WORKDIR /
COPY go.mod go.mod
COPY go.sum go.sum
COPY tools.go tools.go
COPY buildfix.go buildfix.go
COPY config/builder-config.yaml config/builder-config.yaml
COPY internal/spattex/bigquery internal/spattex/bigquery
RUN --mount=type=cache,mode=0755,target=/root/.cache/go-build \
GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o /tmp/ocb \
go.opentelemetry.io/collector/cmd/builder
RUN /tmp/ocb --skip-compilation \
--config config/builder-config.yaml
RUN --mount=type=cache,mode=0755,target=/root/.cache/go-build \
GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o /tmp/bq/bq .
# Build the final (persistent) image
FROM alpine
RUN adduser -S -u 10000 otelex
COPY --from=builder /tmp/bq/bq /bq
COPY config/otelcol-config.yaml otelcol-config.yaml
ENTRYPOINT ["/bq"]
CMD ["--config", "otelcol-config.yaml"]