Raj Babu Das b1169c7315
Adding multi architecture (ARM64 and AMD64) support for signoz components (#201)
* Adding multi arch support for amd64 and arm64

Signed-off-by: rajdas98 <mail.rajdas@gmail.com>

* test

* reset package-lock.json

Signed-off-by: rajdas98 <mail.rajdas@gmail.com>

* reset yarn-lock.json

Signed-off-by: rajdas98 <mail.rajdas@gmail.com>

* reset yarn-lock.json

Signed-off-by: rajdas98 <mail.rajdas@gmail.com>
2021-07-14 23:36:27 +05:30

36 lines
911 B
Docker

FROM golang:1.14-buster AS builder
# Add Maintainer Info
LABEL maintainer="signoz"
ARG TARGETPLATFORM
ENV CGO_ENABLED=0
ENV GOPATH=/go
RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2)
# Prepare and enter src directory
WORKDIR /go/src/github.com/signoz/signoz/pkg/processors/flattener
# Cache dependencies
ADD go.mod .
ADD go.sum .
RUN go mod download -x
# Add the sources and proceed with build
ADD . .
RUN go build -o ./bin/flattener ./main.go
RUN chmod +x ./bin/flattener
# use a minimal alpine image
FROM alpine:3.7
# add ca-certificates in case you need them
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
# set working directory
WORKDIR /root
# copy the binary from builder
COPY --from=builder /go/src/github.com/signoz/signoz/pkg/processors/flattener/bin/flattener .
# run the binary
CMD ["./flattener"]