From e835c205143312bfbdf9e8cd89b28a39c3bcd921 Mon Sep 17 00:00:00 2001 From: Honglei-Cong Date: Tue, 24 Apr 2018 13:19:14 +0800 Subject: [PATCH] update 'make docker' 1. fix config-solo.json 2. update docker file, to support removed --password 3. update config file packing, to solo mode docker --- Makefile | 8 +++++--- config-solo.json | 2 +- docker/Dockerfile | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4d4da1dd94..27dfe6f14b 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ DBUILD=docker build DRUN=docker run DOCKER_NS ?= ontio DOCKER_TAG=$(ARCH)-$(VERSION) -CONFIG_FILES=$(shell ls *.json) +ONT_CFG_IN_DOCKER=config-solo.json WALLET_FILE=wallet.dat all: ontology nodectl @@ -27,12 +27,14 @@ format: $(WALLET_FILE): nodectl ./nodectl wallet -c -p passwordtest -n $(WALLET_FILE) -docker/payload: docker/build/bin/ontology docker/Dockerfile $(CONFIG_FILES) $(WALLET_FILE) +docker/payload: docker/build/bin/ontology docker/Dockerfile $(ONT_CFG_IN_DOCKER) $(WALLET_FILE) @echo "Building ontology payload" @mkdir -p $@ @cp docker/Dockerfile $@ @cp docker/build/bin/ontology $@ - @tar czf $@/config.tgz $(CONFIG_FILES) $(WALLET_FILE) + @cp -f $(ONT_CFG_IN_DOCKER) $@/config.json + @cp -f $(WALLET_FILE) $@ + @tar czf $@/config.tgz -C $@ config.json $(WALLET_FILE) @touch $@ docker/build/bin/%: Makefile diff --git a/config-solo.json b/config-solo.json index 42702ac041..1c6234a786 100644 --- a/config-solo.json +++ b/config-solo.json @@ -6,7 +6,7 @@ "127.0.0.1:20338" ], "Bookkeepers": [ - "021dcb1ae0845b44bbd1ea328bf8245f0386f6611923366f0daa83a97dfd93255c" + "1202021c6750d2c5d99813997438cee0740b04a73e42664c444e778e001196eed96c9d" ], "HttpRestPort": 20334, "HttpWsPort":20335, diff --git a/docker/Dockerfile b/docker/Dockerfile index 64c5425f02..3a44ff8bbf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,7 @@ ENV ONTOLOGY_PATH /var/ontology RUN mkdir -p $ONTOLOGY_PATH COPY ontology $ONTOLOGY_PATH ADD config.tgz $ONTOLOGY_PATH +EXPOSE 20334 20335 20336 20337 20338 20339 WORKDIR $ONTOLOGY_PATH -CMD ["./ontology","-p","passwordtest"] +CMD ["/bin/sh", "-c", "echo passwordtest | ./ontology"]