mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-19 04:06:24 +00:00
For linux arm64 and amd64, as per #586. I moved the builder image into the same dockerfile, and bumped the Go version on it. It didn't seem like the builder dockerfile worked with the latest code anyway (the go modules require go 1.15 and higher). This requires a recent enough docker install with buildx, as well as an arm64 builder. BASEIMAGE is changed to not specify an arch, so that the image will build on its native arch in buildx. Example image is on docker hub as: kelvie/node-problem-detector:v0.8.10-5-gb0fa610
48 lines
1.7 KiB
Docker
48 lines
1.7 KiB
Docker
# Copyright 2016 The Kubernetes Authors All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
ARG BASEIMAGE
|
|
|
|
FROM golang:1.17.7 as builder
|
|
LABEL maintainer="Andy Xie <andy.xning@gmail.com>"
|
|
|
|
ENV GOPATH /gopath/
|
|
ENV PATH $GOPATH/bin:$PATH
|
|
|
|
RUN apt-get update && apt-get --yes install libsystemd-dev
|
|
RUN go version
|
|
RUN go get github.com/tools/godep
|
|
RUN godep version
|
|
|
|
COPY . /gopath/src/k8s.io/node-problem-detector/
|
|
WORKDIR /gopath/src/k8s.io/node-problem-detector
|
|
RUN make bin/node-problem-detector bin/health-checker bin/log-counter
|
|
|
|
ARG BASEIMAGE
|
|
FROM ${BASEIMAGE}
|
|
|
|
MAINTAINER Random Liu <lantaol@google.com>
|
|
|
|
RUN clean-install util-linux libsystemd0 bash
|
|
|
|
# Avoid symlink of /etc/localtime.
|
|
RUN test -h /etc/localtime && rm -f /etc/localtime && cp /usr/share/zoneinfo/UTC /etc/localtime || true
|
|
|
|
COPY --from=builder /gopath/src/k8s.io/node-problem-detector/bin/node-problem-detector /node-problem-detector
|
|
|
|
ARG LOGCOUNTER
|
|
COPY --from=builder /gopath/src/k8s.io/node-problem-detector/bin/health-checker /gopath/src/k8s.io/node-problem-detector/${LOGCOUNTER} /home/kubernetes/bin/
|
|
|
|
COPY --from=builder /gopath/src/k8s.io/node-problem-detector/config/ /config
|
|
ENTRYPOINT ["/node-problem-detector", "--config.system-log-monitor=/config/kernel-monitor.json"]
|