-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 1.05 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (23 loc) · 1.05 KB
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
FROM golang:1.25 AS build
ARG CADVISOR_VERSION='master'
RUN apt update && \
apt install -y git dmsetup make gcc && \
git clone https://github.com/google/cadvisor.git /go/src/github.com/google/cadvisor
WORKDIR /go/src/github.com/google/cadvisor
RUN git fetch --tags && \
git checkout ${CADVISOR_VERSION} && \
go env -w GO111MODULE=auto && \
make build && \
[ -f "./cadvisor" ] || \
mv ./_output/cadvisor ./cadvisor
FROM alpine:latest
RUN apk --no-cache add libc6-compat device-mapper findutils ndctl zfs && \
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/*
COPY --from=build /go/src/github.com/google/cadvisor/cadvisor /usr/bin/cadvisor
EXPOSE 8080
ENV CADVISOR_HEALTHCHECK_URL=http://localhost:8080/healthz
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider $CADVISOR_HEALTHCHECK_URL || exit 1
ENTRYPOINT ["/usr/bin/cadvisor", "-logtostderr"]