diff --git a/deploy/Dockerfile b/deploy/Dockerfile new file mode 100644 index 00000000..ba8eb614 --- /dev/null +++ b/deploy/Dockerfile @@ -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"] diff --git a/deploy/docker-only/Dockerfile b/deploy/docker-only/Dockerfile deleted file mode 100644 index a3b18888..00000000 --- a/deploy/docker-only/Dockerfile +++ /dev/null @@ -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"] diff --git a/deploy/lmctfy-docker/Dockerfile b/deploy/lmctfy-docker/Dockerfile deleted file mode 100644 index 6060cff0..00000000 --- a/deploy/lmctfy-docker/Dockerfile +++ /dev/null @@ -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"] diff --git a/deploy/prepare.sh b/deploy/prepare.sh new file mode 100644 index 00000000..8ee35cc3 --- /dev/null +++ b/deploy/prepare.sh @@ -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