Skip to content

Commit

Permalink
Make cAdvisor Dockerimage much smaller.
Browse files Browse the repository at this point in the history
Remove old Dockerfiles for deployment and create a new one that only
includes the statically linked binaries we need. This creates an image
that is ~22MB in size.
  • Loading branch information
vmarmol committed Jul 16, 2014
1 parent dbdf923 commit 93754d7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
11 changes: 11 additions & 0 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
9 changes: 0 additions & 9 deletions deploy/docker-only/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/lmctfy-docker/Dockerfile

This file was deleted.

11 changes: 11 additions & 0 deletions deploy/prepare.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 93754d7

Please sign in to comment.