Files
linuxkit/alpine/packages/proxy/Makefile
Justin Cormack b184b3f0e1 Compile Go code with docker run not docker build
Go code is really fast to compile so we do not really need to use the
cache features of `docker build`. So make a compile container instead.
This can also output a build context and Dockerfile if you want to do
a build.

For reference, an uncached `docker build` of our Go code takes about
7s, a cached one 1.2s, and this takes 1.7s, so the best case is a little
worse, but we save a lot of images, and the worst case is better.

This is mainly designed to make the nested builds for containerd
containers simpler too. Will add a variant for the C code as well.

Also add `-static` to the flags so we always make static executables,
which was omitted previously.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-13 15:49:51 +00:00

23 lines
554 B
Makefile

# Tag: 470f68ec32e016484fb8e0bcc2f06cd3f201ea68
GO_COMPILE=mobylinux/go-compile@sha256:b723c0e95a6293300392e57d6ab52574f9217e2410b390a24cbfc4f9070edb6b
all: usr/bin/slirp-proxy sbin/proxy-vsockd
DEPS=Dockerfile $(wildcard *.go libproxy/*.go)
proxy: $(DEPS) ../vendor/manifest
tar cf - $(DEPS) -C .. vendor | docker run --rm --net=none --log-driver=none -i $(GO_COMPILE) -o $@ | tar xf -
usr/bin/slirp-proxy: proxy
mkdir -p usr/bin
cp proxy $@
sbin/proxy-vsockd: proxy
mkdir -p sbin
cp proxy $@
clean:
rm -rf proxy sbin usr
.DELETE_ON_ERROR: