1
0

Dockerfile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. FROM golang:1.13-buster AS builder
  2. ENV VERSION v0.39.2
  3. RUN apt-get update \
  4. && apt-get install make git bash gcc \
  5. && mkdir -p $GOPATH/src/github.com/google \
  6. && git clone https://github.com/google/cadvisor.git $GOPATH/src/github.com/google/cadvisor
  7. WORKDIR $GOPATH/src/github.com/google/cadvisor
  8. RUN git fetch --tags \
  9. && git checkout $VERSION \
  10. && make build \
  11. && cp ./cadvisor /
  12. # ------------------------------------------
  13. # Copied over from deploy/Dockerfile except that the "zfs" dependency has been removed
  14. # a its not available fro Alpine on ARM
  15. FROM alpine:3.10
  16. MAINTAINER [email protected] [email protected] [email protected] [email protected] [email protected]
  17. RUN apk --no-cache add libc6-compat device-mapper findutils && \
  18. apk --no-cache add thin-provisioning-tools --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \
  19. echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
  20. rm -rf /var/cache/apk/*
  21. # Grab cadvisor from the staging directory.
  22. COPY --from=builder /cadvisor /usr/bin/cadvisor
  23. EXPOSE 8080
  24. HEALTHCHECK --interval=30s --timeout=3s \
  25. CMD wget --quiet --tries=1 --spider http://localhost:8080/healthz || exit 1
  26. ENTRYPOINT ["/usr/bin/cadvisor", "-logtostderr"]