mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-29 05:27:41 +00:00
clean up diagnostics server build
Signed-off-by: Justin Cormack <justin@specialbusservice.com>
This commit is contained in:
parent
d0c3e873f6
commit
168fdedace
2
alpine/packages/diagnostics/.gitignore
vendored
2
alpine/packages/diagnostics/.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
diagnostics-server
|
diagnostics-server
|
||||||
/vendor
|
files
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2
|
FROM mobylinux/alpine-build-go:30067067003d565887d7efe533eba03ed46038d2
|
||||||
|
|
||||||
RUN mkdir -p /go/src/diagnostics
|
COPY ./ /go/src/diagnostics-server/
|
||||||
WORKDIR /go/src/diagnostics
|
|
||||||
|
|
||||||
COPY . /go/src/diagnostics
|
WORKDIR /go/src/diagnostics-server
|
||||||
|
|
||||||
ARG GOARCH
|
|
||||||
ARG GOOS
|
|
||||||
|
|
||||||
RUN go install --ldflags '-extldflags "-fno-PIC"'
|
RUN go install --ldflags '-extldflags "-fno-PIC"'
|
||||||
|
|
||||||
RUN [ -f /go/bin/*/diagnostics ] && mv /go/bin/*/diagnostics /go/bin/ || true
|
CMD ["tar", "cf", "-", "-C", "/go/bin", "diagnostics-server"]
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
all: diagnostics-server
|
all: diagnostics-server
|
||||||
|
|
||||||
.PHONY: vendor
|
files:
|
||||||
vendor:
|
ls Dockerfile *.go > files
|
||||||
mkdir -p ./vendor
|
printf -- '-C\n..\n' >> files
|
||||||
cp -r ../vendor/* ./vendor/
|
(cd .. && find vendor) >> files
|
||||||
|
|
||||||
diagnostics-server: Dockerfile main.go vendor
|
diagnostics-server: Dockerfile $(wildcard *.go) ../vendor/manifest files
|
||||||
docker build --build-arg GOOS=$(OS) --build-arg GOARCH=$(ARCH) -t diagnostics:build .
|
tar cf - -T files | docker build -t diagnostics-server:build -
|
||||||
docker run --rm diagnostics:build cat /go/bin/diagnostics > diagnostics-server
|
docker run --rm diagnostics-server:build | tar xf -
|
||||||
chmod 755 diagnostics-server
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf diagnostics-server vendor
|
rm -rf diagnostics-server files
|
||||||
docker images -q diagnostics:build | xargs docker rmi -f || true
|
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
Loading…
Reference in New Issue
Block a user