-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerFile
43 lines (36 loc) · 894 Bytes
/
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
# build stage
FROM golang:1.19.3-alpine AS build-env
RUN apk --no-cache add build-base git gcc
RUN mkdir -p /build
COPY ./ /build/
WORKDIR /build/client/
RUN go version
#RUN git checkout main && go build -o steward
RUN go build -o usbtcpclient
RUN pwd
RUN ls -l
# final stage
FROM alpine
RUN apk update && apk add curl
WORKDIR /app
COPY --from=build-env /build/client/usbtcpclient /app/
# If MTLS is enabled, give the path to the CA cert
ENV CA_CERT ""
# The path to the certificate
ENV CERT ""
# 127.0.0.1:45000
ENV IP_PORT ""
# If MTLS is enabled, give the path to the key
ENV KEY ""
# Set to 1 to enable MTLS
ENV MTLS ""
# The directory path for where to store the port.info file
ENV PORT_INFO_FILE_DIR ""
CMD ["ash","-c","/app/usbtcpclient\
-caCert=$CA_CERT\
-cert=$CERT\
-ipPort=$IP_PORT\
-key=$KEY\
-mtls=$MTLS\
-portInfoFileDir=$PORT_INFO_FILE_DIR\
"]