Merge pull request #88 from vmarmol/smaller

Make cAdvisor Docker image much smaller.
This commit is contained in:
monnand 2014-07-16 14:12:54 -04:00
commit e2ff7dbb13
4 changed files with 22 additions and 23 deletions

11
deploy/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM scratch
MAINTAINER dengnan@google.com vmarmol@google.com
# NOTE: Run prepare.sh before building this Docker image.
# Grab lmctfy and cadvisor from the staging directory.
ADD lmctfy /usr/bin/lmctfy
ADD cadvisor /usr/bin/cadvisor
EXPOSE 8080
ENTRYPOINT ["/usr/bin/cadvisor"]

View File

@ -1,9 +0,0 @@
FROM busybox:ubuntu-14.04
MAINTAINER kyurtsever@google.com dengnan@google.com vmarmol@google.com jason@swindle.me
# Get cAdvisor binaries.
ADD http://storage.googleapis.com/cadvisor-bin/cadvisor-0.1.3 /usr/bin/cadvisor
RUN chmod +x /usr/bin/cadvisor
EXPOSE 8080
ENTRYPOINT ["/usr/bin/cadvisor"]

View File

@ -1,14 +0,0 @@
FROM ubuntu:14.04
MAINTAINER kyurtsever@google.com dengnan@google.com vmarmol@google.com
# Get the lmctfy dependencies.
RUN apt-get update && apt-get install -y -q --no-install-recommends pkg-config libprotobuf8 libapparmor1
# Get the lcmtfy and cAdvisor binaries.
ADD http://storage.googleapis.com/cadvisor-bin/lmctfy/lmctfy /usr/bin/lmctfy
ADD http://storage.googleapis.com/cadvisor-bin/lmctfy/libre2.so.0.0.0 /usr/lib/libre2.so.0
ADD http://storage.googleapis.com/cadvisor-bin/cadvisor-0.1.3 /usr/bin/cadvisor
RUN chmod +x /usr/bin/lmctfy && chmod +x /usr/bin/cadvisor
EXPOSE 8080
ENTRYPOINT ["/usr/bin/cadvisor"]

11
deploy/prepare.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
set -x
# Download lmctfy.
wget http://storage.googleapis.com/cadvisor-bin/lmctfy/lmctfy
chmod +x lmctfy
# Statically build cAdvisor from source and stage it.
go build --ldflags '-extldflags "-static"' github.com/google/cadvisor