-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.trace.aws
34 lines (25 loc) · 1.08 KB
/
Dockerfile.trace.aws
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
# Stage 0: Build #
# Use the official Golang image to create a build artifact.
# This is based on Debian and sets the GOPATH to /go.
FROM golang:1.19 as BUILDER
# Create and change to the app directory.
WORKDIR /app
# Retrieve application dependencies using go modules.
# Allows container builds to reuse downloaded dependencies.
COPY go.* ./
RUN go mod download
# Copy local code to the container image.
COPY . ./
# Build the binary.
WORKDIR /app/server/trace-func-go/aws
# -mod=readonly: ensures immutable go.mod and go.sum in container builds.
# CGO_ENABLED=1: uses common libraries found on most major OS distributions.
# GOARCH=amd64 GOGCCFLAGS=-m64: specifies x86, 64-bit GCC.
RUN CGO_ENABLED=1 GOARCH=amd64 GOGCCFLAGS=-m64 GOOS=linux go build -mod=readonly -v -o server
# Stage 1: Run #
FROM debian:stable-slim
# Copy the binary to the production image from the BUILDER stage.
COPY --from=BUILDER /app/server/trace-func-go/aws/server /server
# Run the web service on container startup.
ENTRYPOINT ["/server"]
LABEL org.opencontainers.image.source=https://github.com/vhive-serverless/invitro