migrate
This commit is contained in:
3
app/build/.gitignore
vendored
Normal file
3
app/build/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Dockerfile.dapper[0-9]*
|
||||
.dapper
|
||||
bin/
|
||||
10
app/build/Dockerfile.dapper
Normal file
10
app/build/Dockerfile.dapper
Normal 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
22
app/build/Makefile
Normal 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
7
app/build/scripts/cli
Executable 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
13
app/build/scripts/entry
Executable 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}
|
||||
Reference in New Issue
Block a user