-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.debug
More file actions
57 lines (48 loc) · 1.77 KB
/
Dockerfile.debug
File metadata and controls
57 lines (48 loc) · 1.77 KB
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
55
56
57
FROM golang:1.24-bookworm
# Configure go env
ENV GOPATH=/usr/local/golib
RUN export GOPATH=$GOPATH
RUN go env -w GO111MODULE=auto
RUN export CGO_ENABLED=0
# Copy source files
COPY cmd $GOPATH/src/github.com/OpenCHAMI/remote-console/v2/cmd
COPY configs configs
COPY scripts scripts
COPY internal $GOPATH/src/github.com/OpenCHAMI/remote-console/v2/internal
COPY go.mod $GOPATH/src/github.com/OpenCHAMI/remote-console/v2/go.mod
COPY go.sum $GOPATH/src/github.com/OpenCHAMI/remote-console/v2/go.sum
# Build the image
RUN go build -C $GOPATH/src/github.com/OpenCHAMI/remote-console/v2/cmd/remote-console -v \
-gcflags=all="-N -l" \
-o /usr/local/bin/remote-console
RUN set -eux \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ipmitool \
libfreeipmi17 \
libipmiconsole2 \
iputils-ping \
coreutils \
conman \
libcap2-bin \
expect \
openssh-client \
sshpass \
vim \
bash \
jq \
inotify-tools \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/conman.conf /app/conman_base.conf
COPY scripts/conman.conf /etc/conman.conf
COPY scripts/ssh-key-console /usr/bin/
COPY scripts/ssh-pwd-console /usr/bin/
COPY scripts/ssh-pwd-mtn-console /usr/bin/
COPY configs /app/configs
RUN chmod +775 /usr/bin/ssh-key-console /usr/bin/ssh-pwd-console /usr/bin/ssh-pwd-mtn-console
RUN mkdir -p /var/log/conman/ /var/log/conman.old/ \
&& chown -Rv 65534:65534 /app /etc/conman.conf /var/log/conman/ /var/log/conman.old/
RUN go install github.com/go-delve/delve/cmd/dlv@v1.24.0
USER 65534:65534
ENTRYPOINT ["/usr/local/golib/bin/dlv"]
CMD ["exec", "--continue", "--accept-multiclient", "--headless", "--api-version=2", "--listen=:2345", "--log", "/usr/local/bin/remote-console"]