This commit is contained in:
Mike Trudeau
2026-02-13 20:33:17 +00:00
parent 008f60446f
commit 2d168f4a3a
64 changed files with 11570 additions and 0 deletions

3
app/build/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
Dockerfile.dapper[0-9]*
.dapper
bin/

View File

@@ -0,0 +1,10 @@
FROM dockercore/golang-cross:latest
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends libusb-1.0-0-dev
ENV DAPPER_SOURCE /source
ENV DAPPER_OUTPUT ./build/bin
WORKDIR ${DAPPER_SOURCE}
ENTRYPOINT ["./build/scripts/entry"]
CMD ["cli"]

22
app/build/Makefile Normal file
View File

@@ -0,0 +1,22 @@
TARGETS := $(shell ls scripts)
.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
$(TARGETS): .dapper
cd ../ && $(PWD)/.dapper -f build/Dockerfile.dapper $@
@yes | docker image prune > /dev/null
.PHONY: $(TARGETS)
.DEFAULT_GOAL := cli
clean:
@rm -rf $(PWD)/bin $(PWD)/.dapper $(PWD)/Dockerfile.dapper[0-9]*
@docker rmi app:master
shell-bind: .dapper
cd ../ && $(PWD)/.dapper -f build/Dockerfile.dapper -m bind -s

7
app/build/scripts/cli Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
set -e
## multi-platform cli build
make cli
cp bin/*cli* ${DAPPER_OUTPUT}/
ls -la ${DAPPER_OUTPUT}/*cli*

13
app/build/scripts/entry Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
mkdir -p ${DAPPER_OUTPUT}
if [ -e ${DIR}/$1 ]; then
${DIR}/"$@"
else
exec "$@"
fi
chown -R $DAPPER_UID:$DAPPER_GID ${DAPPER_OUTPUT}