-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·73 lines (48 loc) · 1.98 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -----------------------------------------------------------------------------
# Stages
# -----------------------------------------------------------------------------
ARG IMAGE_GO_BUILDER=golang:1.21.4-bullseye
ARG IMAGE_FINAL=senzing/senzingapi-runtime:3.8.0
# -----------------------------------------------------------------------------
# Stage: senzingapi_runtime
# -----------------------------------------------------------------------------
FROM ${IMAGE_FINAL} as senzingapi_runtime
# -----------------------------------------------------------------------------
# Stage: go_builder
# -----------------------------------------------------------------------------
FROM ${IMAGE_GO_BUILDER} as go_builder
ENV REFRESHED_AT=2023-12-04
LABEL Name="senzing/template-go-builder" \
Maintainer="support@senzing.com" \
Version="0.0.1"
# Copy local files from the Git repository.
COPY ./rootfs /
COPY . ${GOPATH}/src/template-go
# Copy files from prior stage.
COPY --from=senzingapi_runtime "/opt/senzing/g2/lib/" "/opt/senzing/g2/lib/"
COPY --from=senzingapi_runtime "/opt/senzing/g2/sdk/c/" "/opt/senzing/g2/sdk/c/"
# Set path to Senzing libs.
ENV LD_LIBRARY_PATH=/opt/senzing/g2/lib/
# Build go program.
WORKDIR ${GOPATH}/src/template-go
RUN make build
# Copy binaries to /output.
RUN mkdir -p /output \
&& cp -R ${GOPATH}/src/template-go/target/* /output/
# -----------------------------------------------------------------------------
# Stage: final
# -----------------------------------------------------------------------------
FROM ${IMAGE_FINAL} as final
ENV REFRESHED_AT=2023-12-04
LABEL Name="senzing/template-go" \
Maintainer="support@senzing.com" \
Version="0.0.1"
# Copy local files from the Git repository.
COPY ./rootfs /
# Copy files from prior stage.
COPY --from=go_builder "/output/linux/template-go" "/app/template-go"
# Runtime environment variables.
ENV LD_LIBRARY_PATH=/opt/senzing/g2/lib/
# Runtime execution.
WORKDIR /app
ENTRYPOINT ["/app/template-go"]