mirror of
https://github.com/optim-enterprises-bv/databunker.git
synced 2025-11-01 10:27:56 +00:00
new version of docker integration
This commit is contained in:
@@ -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
14
run.sh
@@ -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
|
||||
Reference in New Issue
Block a user