Create cadvisor

This commit is contained in:
Stille 2021-07-05 12:26:13 +08:00
parent 978884fa06
commit 9e0abbcd95
2 changed files with 50 additions and 0 deletions

35
cadvisor/Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM golang:1.13-buster AS builder
ENV VERSION v0.39.2
RUN apt-get update \
&& apt-get install make git bash gcc \
&& mkdir -p $GOPATH/src/github.com/google \
&& git clone https://github.com/google/cadvisor.git $GOPATH/src/github.com/google/cadvisor
WORKDIR $GOPATH/src/github.com/google/cadvisor
RUN git fetch --tags \
&& git checkout $VERSION \
&& make build \
&& cp ./cadvisor /
# ------------------------------------------
# Copied over from deploy/Dockerfile except that the "zfs" dependency has been removed
# a its not available fro Alpine on ARM
FROM alpine:3.10
MAINTAINER dengnan@google.com vmarmol@google.com vishnuk@google.com jimmidyson@gmail.com stclair@google.com
RUN apk --no-cache add libc6-compat device-mapper findutils && \
apk --no-cache add thin-provisioning-tools --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf /var/cache/apk/*
# Grab cadvisor from the staging directory.
COPY --from=builder /cadvisor /usr/bin/cadvisor
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider http://localhost:8080/healthz || exit 1
ENTRYPOINT ["/usr/bin/cadvisor", "-logtostderr"]

15
cadvisor/README.md Normal file
View File

@ -0,0 +1,15 @@
## cadvisor
GitHub [stilleshan/dockerfiles](https://github.com/stilleshan/dockerfiles)
Docker [stilleshan/cadvisor](https://hub.docker.com/r/stilleshan/cadvisor)
> *docker image support for X86 and ARM*
## 简介
基于 [google/cadvisor](https://github.com/google/cadvisor) 项目的 docker 镜像.
## 更新
**2021-07-05** 更新 docker 镜像,新增同时支持 X86 和 ARM 架构.
## 使用
详细使用教程请参考 [google/cadvisor](https://github.com/google/cadvisor) 官方项目