Skip to content

Commit

Permalink
更换指定版本的方式
Browse files Browse the repository at this point in the history
  • Loading branch information
he-sb authored Aug 2, 2022
1 parent 79afe38 commit 6aa3101
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
FROM golang:1.18 AS build

ARG CADVISOR_VERSION='v0.44.0'
ARG CADVISOR_VERSION='master'

RUN apt update && apt install -y git dmsetup && \
git clone -b ${CADVISOR_VERSION} https://github.com/google/cadvisor.git /go/src/github.com/google/cadvisor
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 make
RUN git fetch --tags && \
git checkout ${CADVISOR_VERSION} && \
go env -w GO111MODULE=auto && \
make build

FROM alpine:latest

RUN apk --no-cache add libc6-compat device-mapper findutils 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/*
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

Expand Down

0 comments on commit 6aa3101

Please sign in to comment.