caiok commented on a change in pull request #197: BOOKKEEPER-974: Add an 
official bookkeeper docker image
URL: https://github.com/apache/bookkeeper/pull/197#discussion_r127252406
 
 

 ##########
 File path: docker/Makefile
 ##########
 @@ -0,0 +1,180 @@
+
+VERSION ?= 4.4.0-alpine
+IMAGE ?= caiok/bookkeeper:$(VERSION)
+BOOKIE ?= 1
+DOCKER_NETWORK ?= bk_network
+
+BUILD_DIR ?= $(VERSION)
+
+CONTAINER_NAME = bookkeeper-$(BOOKIE)
+DOCKER_HOSTNAME = $(shell hostname)
+BK_LOCAL_DATA_DIR = /tmp/test_bk
+BK_LOCAL_CONTAINER_DATA_DIR = $(BK_LOCAL_DATA_DIR)/$(CONTAINER_NAME)
+
+ZK_CONTAINER_NAME=test_zookeeper
+ZK_LOCAL_DATA_DIR=$(BK_LOCAL_DATA_DIR)/zookkeeper
+
+CONTAINER_IP=$(shell docker inspect --format '{{ .NetworkSettings.IPAddress 
}}' $(CONTAINER_NAME))
+
+#NOCACHE=--no-cache
+NOCACHE=
+
+# -------------------------------- #
+
+.PHONY: all build run create start stop shell exec root-shell root-exec info 
ip clean-files clean
+
+# -------------------------------- #
+
+all:
+       make info
+
+# -------------------------------- #
+
+# Build the bookkeeper image.
+#   make build
+
+build:
+       #-docker rmi -f $(IMAGE)
+       
+       cd $(BUILD_DIR) ; \
+       time docker build \
+           $(NOCACHE) \
+           -t $(IMAGE) .
+
+# -------------------------------- #
+
+# Create and run a bookkeeper container with data persisted on local 
filesystem. It needs the zookkeeper container.
+# In order to launch several bookies, the command need the bookie number
+#   make run-bk BOOKIE=4
+
+run-bk:
+       # Temporary gimmick: clear all data because of bookkeeper blocking 
check on host / data integrity
+       #-sudo rm -rf $(BK_LOCAL_CONTAINER_DATA_DIR)
+       
+       mkdir -p $(BK_LOCAL_DATA_DIR) \
+                       $(BK_LOCAL_CONTAINER_DATA_DIR) \
+                       $(BK_LOCAL_CONTAINER_DATA_DIR)/journal \
+                       $(BK_LOCAL_CONTAINER_DATA_DIR)/ledger \
+                       $(BK_LOCAL_CONTAINER_DATA_DIR)/index
+       
+       -docker rm -f $(CONTAINER_NAME)
+       docker run -it\
+               --network $(DOCKER_NETWORK) \
+           --volume $(BK_LOCAL_CONTAINER_DATA_DIR)/journal:/data/journal \
 
 Review comment:
   You have to manually mount them. E.g:
   --volume /real/path/1:/data/journal/journal-1
   --volume /real/path/2:/data/journal/journal-2
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to