-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
54 lines (48 loc) · 1.86 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
# SPDX-FileCopyrightText: 2018 vasu1124
#
# SPDX-License-Identifier: GPL-3.0-or-later
FROM golang:1.22-alpine as builder
ARG gitVersion=0.0.0-dev
ARG gitCommit=0000000000000000000000000000000000000000
ARG gitTreeState="dirty"
WORKDIR /introspect
# RUN GO111MODULE=off go get github.com/go-delve/delve/cmd/dlv
COPY go.* ./
COPY cmd cmd
COPY pkg pkg
COPY .env ./
RUN buildDate=$(date -I'seconds'); \
go build \
-ldflags "\
-X github.com/vasu1124/introspect/pkg/version.gitVersion=${gitVersion} \
-X github.com/vasu1124/introspect/pkg/version.gitCommit=${gitCommit} \
-X github.com/vasu1124/introspect/pkg/version.gitTreeState=${gitTreeState} \
-X github.com/vasu1124/introspect/pkg/version.buildDate=${buildDate} \
" \
-o introspect-linux ./cmd
# final stage
FROM alpine:3
LABEL maintainer="vasu1124@actvirtual.com" \
immutable.labels=true \
org.opencontainers.image.vendor="actvirtual" \
org.opencontainers.image.licenses="GPL-3.0" \
org.opencontainers.image.title="Introspect" \
org.opencontainers.image.source="https://github.com/vasu1124/introspect" \
org.opencontainers.image.description="DemoSuite for Kubernetes" \
com.actvirtual.quality="evaluation" \
com.actvirtual.product="DemoSuite"
WORKDIR /introspect
RUN apk --no-cache add --update bash ca-certificates libc6-compat \
&& rm -rf /var/cache/apk/*
# COPY --from=builder /go/bin/dlv ./
COPY --from=builder /introspect/introspect-linux ./
COPY tmpl tmpl
COPY css css
EXPOSE 9090 9443
CMD ["./introspect-linux"]
# If you want to use the debugger, you need to modify the
# container and point it to the "dlv debug" command:
# Start the "dlv debug" server on port 3000 of the container. (Note that the
# application process will NOT start until the debugger is attached.)
# EXPOSE 3000
# CMD ["./dlv", "debug", "./cmd", "--api-version=2", "--headless", "--listen=:3000", "--log"]