-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile
68 lines (57 loc) · 1.91 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM golang:1.20 as builder
WORKDIR /code
COPY go.mod go.sum /code/
RUN go mod download
COPY . /code
RUN make build
FROM alpine:3.8
LABEL maintainers="https://tinkerbell.org/community/slack/"
ARG IPMITOOL_REPO=https://github.com/ipmitool/ipmitool.git
ARG IPMITOOL_COMMIT=19d78782d795d0cf4ceefe655f616210c9143e62
ARG GRPC_HEALTH_PROBE_VERSION=v0.3.4
WORKDIR /tmp
RUN apk add --update --upgrade --no-cache --virtual build-deps \
alpine-sdk=1.0-r0 \
autoconf=2.69-r2 \
automake=1.16.1-r0 \
git=2.18.4-r0 \
libtool=2.4.6-r5 \
ncurses-dev=6.1_p20180818-r1 \
openssl-dev=1.0.2u-r0 \
readline-dev=7.0.003-r0 \
&& apk add --update --upgrade --no-cache --virtual run-deps \
ca-certificates=20191127-r2 \
libcrypto1.0=1.0.2u-r0 \
musl=1.1.19-r11 \
readline=7.0.003-r0 \
&& git clone -b master ${IPMITOOL_REPO}
WORKDIR /tmp/ipmitool
#
# cherry-pick'ed 1edb0e27e44196d1ebe449aba0b9be22d376bcb6
# to fix https://github.com/ipmitool/ipmitool/issues/377
#
RUN git checkout ${IPMITOOL_COMMIT} \
&& git config --global user.email "[email protected]" \
&& git cherry-pick 1edb0e27e44196d1ebe449aba0b9be22d376bcb6 \
&& ./bootstrap \
&& ./configure \
--prefix=/usr/local \
--enable-ipmievd \
--enable-ipmishell \
--enable-intf-lan \
--enable-intf-lanplus \
--enable-intf-open \
&& make \
&& make install \
&& apk del build-deps
WORKDIR /tmp
RUN rm -rf /tmp/ipmitool \
&& wget -O/tmp/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 \
&& chmod +x /tmp/grpc_health_probe
ENV GIN_MODE release
USER pbnj
EXPOSE 50051 9090 8080
COPY scripts/etc-passwd /etc/passwd
COPY --from=builder /code/bin/pbnj-linux-amd64 /pbnj-linux-amd64
ENTRYPOINT ["/pbnj-linux-amd64"]
CMD ["server"]