mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
Clean up proxy Makefile
Model for the others, make sure dependencies are correct and that only the exactly correct things are passed to Docker. No longer copy vendor directory. Signed-off-by: Justin Cormack <justin@specialbusservice.com>
This commit is contained in:
parent
91507f1382
commit
b69893eb6d
@ -16,8 +16,8 @@ COPY kernel/$ARCH/kernel-source-info /etc/
|
||||
ADD kernel/$ARCH/kernel-patches.tar /etc/kernel-patches
|
||||
ADD kernel/$ARCH/kernel-modules.tar /
|
||||
|
||||
COPY packages/proxy/slirp-proxy /usr/bin/
|
||||
COPY packages/proxy/slirp-proxy /sbin/proxy-vsockd
|
||||
COPY packages/proxy/proxy /usr/bin/slirp-proxy
|
||||
COPY packages/proxy/proxy /sbin/proxy-vsockd
|
||||
COPY packages/proxy/etc /etc/
|
||||
COPY packages/transfused/transfused /sbin/
|
||||
COPY packages/transfused/etc /etc/
|
||||
|
@ -1,5 +1,5 @@
|
||||
all:
|
||||
$(MAKE) -C proxy OS=linux
|
||||
$(MAKE) -C proxy
|
||||
$(MAKE) -C diagnostics OS=linux
|
||||
$(MAKE) -C transfused OS=linux
|
||||
$(MAKE) -C tap-vsockd OS=linux
|
||||
|
4
alpine/packages/proxy/.gitignore
vendored
4
alpine/packages/proxy/.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
/slirp-proxy
|
||||
/vendor
|
||||
proxy
|
||||
files
|
||||
|
@ -5,9 +5,6 @@ WORKDIR /go/src/proxy
|
||||
|
||||
COPY ./ /go/src/proxy/
|
||||
|
||||
ARG GOARCH
|
||||
ARG GOOS
|
||||
|
||||
RUN go install --ldflags '-extldflags "-fno-PIC"'
|
||||
|
||||
RUN [ -f /go/bin/*/proxy ] && mv /go/bin/*/proxy /go/bin/ || true
|
||||
CMD ["tar", "cf", "-", "-C", "/go/bin", "proxy"]
|
||||
|
@ -1,15 +1,16 @@
|
||||
all: proxy
|
||||
|
||||
.PHONY: vendor
|
||||
vendor:
|
||||
mkdir -p ./vendor
|
||||
cp -r ../go/vendor/* ./vendor/
|
||||
files:
|
||||
ls Dockerfile *.go > files
|
||||
find libproxy >> files
|
||||
printf -- '-C\n../go\n' >> files
|
||||
(cd ../go && find vendor) >> files
|
||||
|
||||
proxy: Dockerfile main.go proxy.go vendor
|
||||
docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t proxy:build .
|
||||
docker run --rm proxy:build cat /go/bin/proxy > slirp-proxy
|
||||
chmod 755 slirp-proxy
|
||||
proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../go/vendor/manifest files
|
||||
tar cf - -T files | docker build -t proxy:build -
|
||||
docker run --rm proxy:build | tar xf -
|
||||
|
||||
clean:
|
||||
rm -rf slirp-proxy vendor
|
||||
docker images -q proxy:build | xargs docker rmi -f || true
|
||||
rm -rf proxy files
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
Loading…
Reference in New Issue
Block a user