jiazhai 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_r127621270
 
 

 ##########
 File path: docker/4.4.0/Dockerfile
 ##########
 @@ -0,0 +1,63 @@
+FROM centos:7
+MAINTAINER Apache BookKeeper <dev@bookkeeper.apache.org>
+
+# Install required packages
+RUN yum install -y \
+        java-1.8.0-openjdk-headless \
+        sudo \
+    && yum clean all
+
+ENV ZK_SERVERS= \
+    BK_USER=bookkeeper \
+    BK_PORT= \
+    BK_BUILD_PORT=3181 \
+    BOOKIE_OPTS="" \
+    BK_JOURNAL_DIR=/data/journal \
+    BK_LEDGER_DIR=/data/ledger \
+    BK_INDEX_DIR=/data/index \
+    BK_LEDGERS_PATH= \
+    BK_TRY_METAFORMAT=
+
+# Add a user and make dirs
+RUN set -x \
+    && adduser "${BK_USER}" \
+    && mkdir -p "${BK_JOURNAL_DIR}" "${BK_LEDGER_DIR}" "${BK_INDEX_DIR}" \
+    && chown "$BK_USER:$BK_USER" "${BK_JOURNAL_DIR}" "${BK_LEDGER_DIR}" 
"${BK_INDEX_DIR}"
+
+ARG GPG_KEY=B3D56514
+ARG BK_VERSION=4.4.0
+
+ENV DISTRO_NAME=bookkeeper-server-${BK_VERSION}-bin
+       
+# Download Apache Bookkeeper, verify its PGP signature, untar and clean up
+RUN set -x \
+    && yum install -y \
+        wget \
+    && mkdir -pv /opt \
+    && cd /opt \
+    && wget -q 
"https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz";
 \
+    && wget -q 
"https://archive.apache.org/dist/bookkeeper/bookkeeper-${BK_VERSION}/${DISTRO_NAME}.tar.gz.asc";
 \
+    && export GNUPGHOME="$(mktemp -d)" \
+    && gpg --keyserver ha.pool.sks-keyservers.net --recv-key "$GPG_KEY" \
+    && gpg --batch --verify "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz" \
+    && tar -xzf "$DISTRO_NAME.tar.gz" \
+    && rm -r "$GNUPGHOME" "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc" \
+    && mv bookkeeper-server-* bookkeeper \
+    && yum remove -y \
+        wget \
+    && yum clean all
+
+ENV BK_DIR=/opt/bookkeeper
+ENV PATH=$PATH:${BK_DIR}/bin
+
+WORKDIR ${BK_DIR}
+VOLUME ["/conf", "${BK_JOURNAL_DIR}", "${BK_LEDGER_DIR}", "${BK_INDEX_DIR}"]
 
 Review comment:
   Hi @caiok ,   Seems in this code, the configuration is depends on local dir 
mounted to "/conf", It is good to run docker locally, but for K8S and DC/OS, it 
is hard to have one "local dir" contains user specified data, because all disk 
resources are managed by and shared in K8S or DC/OS, when disk is arriving to 
satisfy user request, it usually contains nothing.   
   This problem also nags me for a while. I even thought to provide a way, 
which read the configurations from an internet place, but that seems not very 
user friendly.  Until @merlimat provide the way to read env variables inside 
docker.  
   And this maybe the reason that @sijie, @merlimat and me are so care about 
the configurations and env variables. 
 
----------------------------------------------------------------
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