-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
33 lines (29 loc) · 944 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
FROM --platform=${BUILDPLATFORM} golang:1.23.3 AS builder
# Install git.
# Git is required for fetching the dependencies.
#RUN apk update && apk add --no-cache git tzdata
WORKDIR $GOPATH/src/wimaha/teslaBleHttpProxy/
COPY . .
# Fetch dependencies.
# Using go get.
#RUN go get -d -v
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG GOARM=${TARGETVARIANT#v}
#WORKDIR /app/
#ADD . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${GOARM} make build-docker
#RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${GOARM} go build -ldflags="-w -s" -o /go/bin/teslaBleHttpProxy main.go
RUN mkdir -p /go/bin/key
FROM scratch
# Timezone data
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
ENV TZ=Europe/Berlin
#WORKDIR /app/
COPY --from=builder /go/bin/teslaBleHttpProxy /teslaBleHttpProxy
COPY --from=builder /go/bin/key /key
EXPOSE 8080
ENTRYPOINT ["/teslaBleHttpProxy"]