mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 19:28:09 +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-patches.tar /etc/kernel-patches
|
||||||
ADD kernel/$ARCH/kernel-modules.tar /
|
ADD kernel/$ARCH/kernel-modules.tar /
|
||||||
|
|
||||||
COPY packages/proxy/slirp-proxy /usr/bin/
|
COPY packages/proxy/proxy /usr/bin/slirp-proxy
|
||||||
COPY packages/proxy/slirp-proxy /sbin/proxy-vsockd
|
COPY packages/proxy/proxy /sbin/proxy-vsockd
|
||||||
COPY packages/proxy/etc /etc/
|
COPY packages/proxy/etc /etc/
|
||||||
COPY packages/transfused/transfused /sbin/
|
COPY packages/transfused/transfused /sbin/
|
||||||
COPY packages/transfused/etc /etc/
|
COPY packages/transfused/etc /etc/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
all:
|
all:
|
||||||
$(MAKE) -C proxy OS=linux
|
$(MAKE) -C proxy
|
||||||
$(MAKE) -C diagnostics OS=linux
|
$(MAKE) -C diagnostics OS=linux
|
||||||
$(MAKE) -C transfused OS=linux
|
$(MAKE) -C transfused OS=linux
|
||||||
$(MAKE) -C tap-vsockd 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
|
proxy
|
||||||
/vendor
|
files
|
||||||
|
@ -5,9 +5,6 @@ WORKDIR /go/src/proxy
|
|||||||
|
|
||||||
COPY ./ /go/src/proxy/
|
COPY ./ /go/src/proxy/
|
||||||
|
|
||||||
ARG GOARCH
|
|
||||||
ARG GOOS
|
|
||||||
|
|
||||||
RUN go install --ldflags '-extldflags "-fno-PIC"'
|
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
|
all: proxy
|
||||||
|
|
||||||
.PHONY: vendor
|
files:
|
||||||
vendor:
|
ls Dockerfile *.go > files
|
||||||
mkdir -p ./vendor
|
find libproxy >> files
|
||||||
cp -r ../go/vendor/* ./vendor/
|
printf -- '-C\n../go\n' >> files
|
||||||
|
(cd ../go && find vendor) >> files
|
||||||
|
|
||||||
proxy: Dockerfile main.go proxy.go vendor
|
proxy: Dockerfile $(wildcard *.go libproxy/*.go) ../go/vendor/manifest files
|
||||||
docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t proxy:build .
|
tar cf - -T files | docker build -t proxy:build -
|
||||||
docker run --rm proxy:build cat /go/bin/proxy > slirp-proxy
|
docker run --rm proxy:build | tar xf -
|
||||||
chmod 755 slirp-proxy
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf slirp-proxy vendor
|
rm -rf proxy files
|
||||||
docker images -q proxy:build | xargs docker rmi -f || true
|
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
Loading…
Reference in New Issue
Block a user