-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
36 lines (24 loc) · 637 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
##
## Build
##
# pull official base image
FROM golang:bullseye as build-env
# set work directory
WORKDIR /go/aruba_exporter
# copy project from local
COPY . /go/aruba_exporter/
# get modules
RUN go mod download
# build aruba_exporter binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o ./build/aruba_exporter
##
## Deploy
##
# pull official base image
FROM golang:bullseye
# set work directory
WORKDIR /go/aruba_exporter
# copy binary from build-env container
COPY --from=build-env /go/aruba_exporter/build/aruba_exporter ./
# run binary
CMD ["./aruba_exporter", "-config.file", "./config.yaml"]