mirror of
https://github.com/optim-enterprises-bv/databunker.git
synced 2025-11-01 18:38:06 +00:00
2nd version of docker project
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -27,17 +27,21 @@ RUN packr
|
|||||||
RUN go build -o /go/bin/databunker
|
RUN go build -o /go/bin/databunker
|
||||||
# clean packr
|
# clean packr
|
||||||
RUN packr clean
|
RUN packr clean
|
||||||
RUN cp ../run.sh /go/bin/databunker.sh
|
|
||||||
############################
|
############################
|
||||||
# STEP 2 build a small image
|
# STEP 2 build a small image
|
||||||
############################
|
############################
|
||||||
FROM scratch
|
FROM scratch
|
||||||
# Copy our static executable.
|
# Copy our static executable.
|
||||||
COPY --from=builder /bin/sh /bin/sh
|
COPY --from=builder /bin/busybox /bin/busybox
|
||||||
|
COPY --from=builder /bin/busybox /bin/sh
|
||||||
COPY --from=builder /lib/ld* /lib/
|
COPY --from=builder /lib/ld* /lib/
|
||||||
COPY --from=builder /go/bin/databunker /go/bin/databunker
|
COPY --from=builder /go/bin/databunker /databunker/bin/databunker
|
||||||
COPY --from=builder /go/bin/databunker.sh /go/bin/databunker.sh
|
COPY run.sh /databunker/bin/run.sh
|
||||||
|
COPY databunker.yaml /databunker/conf/
|
||||||
|
RUN /bin/busybox mkdir -p /databunker/data
|
||||||
|
RUN /bin/busybox mkdir -p /databunker/certs
|
||||||
|
#RUN /bin/busybox ln -s /bin/busybox /bin/sh
|
||||||
# Run the hello binary.
|
# Run the hello binary.
|
||||||
#ENTRYPOINT ["/go/bin/databunker"]
|
#ENTRYPOINT ["/go/bin/databunker"]
|
||||||
ENTRYPOINT ["/bin/sh", "/go/bin/databunker.sh"]
|
ENTRYPOINT ["/bin/sh", "/databunker/bin/run.sh"]
|
||||||
#CMD ["/bin/sh", "-x", "-c", "/go/bin/databunker -init"]
|
#CMD ["/bin/sh", "-x", "-c", "/go/bin/databunker -init"]
|
||||||
|
|||||||
19
run.sh
19
run.sh
@@ -1,7 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "-------------INIT------------"
|
/bin/busybox find /
|
||||||
/go/bin/databunker -init
|
|
||||||
ls -al /go/bin/
|
DATABUNKER_MASTERKEY=
|
||||||
|
if [ ! -f /databunker/data/databunker.db ]; then
|
||||||
|
echo "-------------INIT------------"
|
||||||
|
/bin/busybox mkdir -p /tmp
|
||||||
|
RESULT=`/databunker/bin/databunker -init > /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`
|
||||||
|
echo "DATABUNKER_ROOTTOKEN $ROOT_TOKEN"
|
||||||
|
echo "DATABUNKER_MASTERKEY $MASTER_KEY"
|
||||||
|
/bin/busybox rm -rf /tmp/init.txt
|
||||||
|
fi
|
||||||
echo "-------------RUN-------------"
|
echo "-------------RUN-------------"
|
||||||
/go/bin/databunker
|
#/go/bin/databunker
|
||||||
Reference in New Issue
Block a user