From 6cdd33c23d49b975d7a1dd9713be7e56973ef263 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Fri, 8 Sep 2017 10:36:35 -0500 Subject: [PATCH] Add docker build from scratch Add docker test function in makefile --- Makefile | 11 +++++++++++ deps/Dockerfile | 8 +++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0d4fc9c..86859b2 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ docker: stat cp bin/lorebot stage.tmp/ cp deps/rootfs.tar.gz stage.tmp/ cp deps/Dockerfile stage.tmp/ + cp deps/redis.conf stage.tmp/ chmod +x deps/run.sh cp deps/run.sh stage.tmp/ cp config.gcfg stage.tmp/ @@ -43,6 +44,16 @@ aci: stat mv lorebot.aci ../ @echo "lorebot.aci built" +test_docker: + mkdir -p /tmp/lorebot/redis/ + touch /tmp/lorebot/dump.rdb + cp .auth /tmp/lorebot/ + sudo docker run \ + -it \ + -v /tmp/lorebot/redis:/redisbackup:rw \ + -v /tmp/lorebot/.auth:/.auth:ro \ + smpldbot + test_aci: mkdir -p /tmp/lorebot/redis/ touch /tmp/lorebot/dump.rdb diff --git a/deps/Dockerfile b/deps/Dockerfile index b73422a..33414de 100644 --- a/deps/Dockerfile +++ b/deps/Dockerfile @@ -1,7 +1,9 @@ -FROM alpine +FROM scratch -RUN apk --update add ca-certificates redis -RUN mkdir /redisbackup/ +#RUN apk --update add ca-certificates redis +#RUN mkdir /redisbackup/ +ADD rootfs.tar.gz / +COPY redis.conf / COPY config.gcfg / COPY lorebot / COPY run.sh /