-
Notifications
You must be signed in to change notification settings - Fork 217
/
Dockerfile.assisted-service-debug
35 lines (23 loc) · 1.22 KB
/
Dockerfile.assisted-service-debug
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
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS golang
RUN GOFLAGS=-mod=mod go install github.com/go-delve/delve/cmd/dlv@v1.21.2
FROM quay.io/centos/centos:stream9 AS builder
RUN dnf install --enablerepo=crb -y gcc git nmstate-devel openssl-devel make && dnf clean all
ENV GOROOT=/usr/lib/golang
ENV GOPATH=/opt/app-root/src/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
# For build-minimal target
ENV DEBUG_SERVICE=true
COPY --from=golang $GOPATH $GOPATH
COPY --from=golang $GOROOT $GOROOT
RUN chmod 775 -R $GOPATH && chmod 775 -R $GOROOT
RUN git config --global --add safe.directory /opt/app-root/src
COPY . ./assisted-service
RUN cd ./assisted-service && make build-minimal
FROM quay.io/centos/centos:stream9
RUN dnf install --enablerepo=crb -y nmstate-devel
ARG DEBUG_SERVICE_PORT=40000
EXPOSE 8090 $DEBUG_SERVICE_PORT
COPY --from=builder /opt/app-root/src/go/bin/dlv /usr/bin/dlv
COPY --from=builder /assisted-service/build/assisted-installer/assisted-service /assisted-service
COPY --from=builder /assisted-service/build/assisted-installer/assisted-service-operator /assisted-service-operator
CMD ["dlv", "--listen=:40000", "--headless=true", "--continue", "--api-version=2", "--accept-multiclient", "exec", "/assisted-service"]