sijie commented on a change in pull request #342: Issue 338: add first draft 
Docker image including community suggestions
URL: https://github.com/apache/bookkeeper/pull/342#discussion_r130938372
 
 

 ##########
 File path: docker/Makefile
 ##########
 @@ -0,0 +1,197 @@
+#!/bin/bash
+#
+#/**
+# * Copyright 2007 The Apache Software Foundation
+# *
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+
+
+VERSION ?= centos
+IMAGE ?= bookkeeper/bookie:$(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)
+BK_DIR = /data
+BK_zkLedgersRootPath = /ledgers
+
+ZK_CONTAINER_NAME=test_zookeeper
+ZK_LOCAL_DATA_DIR=$(BK_LOCAL_DATA_DIR)/zookkeeper
+
+
+CONTAINER_IP=$(shell docker inspect --format '{{ .NetworkSettings.IPAddress 
}}' $(CONTAINER_NAME))
+
+# -------------------------------- #
+
+.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:
+       cd $(BUILD_DIR) ; \
+       time docker build \
+           -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:
+       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) \
 
 Review comment:
   wrong indent?
 
----------------------------------------------------------------
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