-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdev.Dockerfile
43 lines (33 loc) · 1.17 KB
/
dev.Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# syntax=docker/dockerfile:1
FROM golang:1.23 AS backend_builder_dev
ENV CGO_ENABLED 0
ENV GOOS linux
RUN echo "Installing deps..."
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install --no-install-recommends --assume-yes \
# To pull the delve binary \
git \
# protoc binary
protobuf-compiler \
# Needed to validate SSL/TLS certificates
ca-certificates
WORKDIR /
RUN echo "Copying sources..."
COPY backend/go.mod backend/go.sum /
RUN go mod download
COPY backend/ /
RUN echo "Building protobufs..."
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN export PATH="$PATH:$(go env GOPATH)/bin"
RUN protoc --proto_path=admin/ --go_out=admin/ --go-grpc_out=admin/ \
--go_opt=paths=source_relative --go-grpc_opt=paths=source_relative \
admin.proto
RUN echo "Building Goliath core with debug flags..."
RUN go build -v -mod=mod -gcflags="all=-N -l" -o goliath
# Final development image
FROM scratch
COPY --from=backend_builder_dev /goliath /
COPY --from=backend_builder_dev /etc/ssl/certs /etc/ssl/certs/
CMD ["/goliath", "--config=/config.ini"]