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.
12 lines
250 B
Bash
12 lines
250 B
Bash
#!/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
|