mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-02-14 18:09:57 +00:00
48 lines
1.9 KiB
Docker
48 lines
1.9 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.20.0@sha256:f69d47fedd3b2ebd23bcf473c0b78522ebbc1823f06b7d47f45f04a30bdc901d as builder
|
|
LABEL maintainer="Andy Xie <andy.xning@gmail.com>"
|
|
|
|
ENV GOPATH /gopath/
|
|
ENV PATH $GOPATH/bin:$PATH
|
|
|
|
RUN apt-get update --fix-missing && apt-get --yes install libsystemd-dev gcc-aarch64-linux-gnu
|
|
RUN go version
|
|
RUN go install github.com/tools/godep@latest
|
|
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}
|
|
|
|
LABEL maintainer="Random Liu <lantaol@google.com>"
|
|
|
|
RUN clean-install util-linux bash libsystemd-dev
|
|
|
|
# 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"]
|