new version of docker integration

This commit is contained in:
stremovsky
2019-12-15 10:11:25 +02:00
parent 0c634d7e08
commit cbddd36aad
2 changed files with 10 additions and 7 deletions

View File

@@ -17,12 +17,13 @@ RUN go get -u github.com/evanphx/json-patch
RUN go get -u github.com/julienschmidt/httprouter
WORKDIR $GOPATH/src/paranoidguy/databunker/src/
COPY . $GOPATH/src/paranoidguy/databunker/
RUN find $GOPATH/src/paranoidguy/databunker/
# Fetch dependencies.
# Using go get.
RUN go get -d -v
# prepare web to go with packr
RUN packr
# debug
RUN find $GOPATH/src/paranoidguy/databunker/
# Build the binary.
RUN go build -o /go/bin/databunker
# clean packr

14
run.sh
View File

@@ -1,18 +1,20 @@
#!/bin/sh
/bin/busybox find /
/bin/busybox find /databunker
DATABUNKER_MASTERKEY=
DATABUNKER_MASTERKEY=""
if [ ! -f /databunker/data/databunker.db ]; then
echo "-------------INIT------------"
/bin/busybox mkdir -p /tmp
RESULT=`/databunker/bin/databunker -init > /tmp/init.txt`
RESULT=`/databunker/bin/databunker -init -db /databunker/data/databunker.db -conf /databunker/conf/databunker.yaml > /tmp/init.txt`
echo $RESULT
ROOT_TOKEN=`/bin/busybox awk '/API Root token:/ {print $4}' /tmp/init.txt`
MASTER_KEY=`/bin/busybox awk '/Master key:/ {print $3}' /tmp/init.txt`
DATABUNKER_MASTERKEY=`/bin/busybox awk '/Master key:/ {print $3}' /tmp/init.txt`
echo "DATABUNKER_ROOTTOKEN $ROOT_TOKEN"
echo "DATABUNKER_MASTERKEY $MASTER_KEY"
echo "DATABUNKER_MASTERKEY $DATABUNKER_MASTERKEY"
/bin/busybox rm -rf /tmp/init.txt
fi
echo "-------------FIND------------"
/bin/busybox find /databunker
echo "-------------RUN-------------"
#/go/bin/databunker
/databunker/bin/databunker -masterkey $DATABUNKER_MASTERKEY -db /databunker/data/databunker.db -conf /databunker/conf/databunker.yaml