11ARG GO_VERSION=1.17
2- FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} as gobase
2+ FROM --platform=$TARGETPLATFORM golang:${GO_VERSION} as gobase
33ENV GOBIN /usr/local/go/bin
44
5- FROM --platform=$BUILDPLATFORM centos:centos8 AS build-env
5+ FROM --platform=$TARGETPLATFORM centos:centos8 AS builder
66ARG TARGETPLATFORM
77ARG BUILDPLATFORM
88ARG BUILDARCH
@@ -47,11 +47,12 @@ RUN yum -y update; yum clean all; \
4747 yum -y install systemd; yum clean all; \
4848 yum -y install libsystemd-dev; yum clean all;\
4949 yum -y install systemd-devel; yum clean all;\
50+ yum -y install gcc-x86_64-linux-gnu.x86_64; yum clean all;\
51+ yum -y install docker-ce-19.03.15; yum clean all;\
5052 yum -y install make automake gcc gcc-c++ kernel-devel; yum clean all;
5153
5254
5355
54-
5556#######################################################
5657
5758ENV GO111MODULE=on
@@ -60,16 +61,37 @@ ENV GOPROXY=https://goproxy.cn,direct
6061ADD . /src/github.com/AliyunContainerService/node-problem-detector
6162ENV GOPATH /:/src/github.com/AliyunContainerService/node-problem-detector/vendor
6263WORKDIR /src/github.com/AliyunContainerService/node-problem-detector
63- RUN pwd
64- RUN ls
6564
6665RUN # VERSION="{{.VERSION}}"
6766RUN # IMAGES="{{.VERSION}}"
6867RUN # REGIONS="{{.REGIONS}}"
6968RUN # LOG_LEVEL="{{.LOG_LEVEL}}"
7069# RUN ls /src/github.com/AliyunContainerService/node-problem-detector/
71- # RUN cd /workspace/source/src/github.com/AliyunContainerService/node-problem-detector/
72- RUN make ENABLE_JOURNALD=1
70+ # RUN cd /src/github.com/AliyunContainerService/node-problem-detector/
71+
72+ RUN make build-binaries LINUX_PLATFORMS=linux_$TARGETARCH
73+ RUN make build-tar LINUX_PLATFORMS=linux_$TARGETARCH
74+
75+ RUN ls -lR /src/github.com/AliyunContainerService/node-problem-detector/config
76+
77+ RUN ls -l /src/github.com/AliyunContainerService/node-problem-detector/
78+
79+ #######################################################
80+
81+
82+ FROM --platform=$TARGETPLATFORM centos:centos8
83+ MAINTAINER KeyOfSpectator <
[email protected] >
84+
85+ RUN systemctl --version
86+
87+ # RUN clean-install util-linux libsystemd0 systemd bash lsof curl
88+
89+ # Avoid symlink of /etc/localtime.
90+ RUN test -h /etc/localtime && rm -f /etc/localtime && cp /usr/share/zoneinfo/UTC /etc/localtime || true
7391
92+ COPY --from=builder /src/github.com/AliyunContainerService/node-problem-detector/bin/node-problem-detector /node-problem-detector
93+ COPY --from=builder /src/github.com/AliyunContainerService/node-problem-detector/bin/health-checker ${LOGCOUNTER} /home/kubernetes/bin/
7494
75- #######################################################
95+ COPY --from=builder /src/github.com/AliyunContainerService/node-problem-detector/config /config
96+ RUN chmod +x /config/plugin/*.sh
97+ CMD "/node-problem-detector", "--config.system-log-monitor=/config/kernel-monitor.json"
0 commit comments