kishorekasi 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_r129880524
 
 

 ##########
 File path: docker/4.4.0-alpine/Dockerfile
 ##########
 @@ -0,0 +1,61 @@
+FROM java:openjdk-8-jre-alpine
+MAINTAINER Apache BookKeeper <dev@bookkeeper.apache.org>
+
+# Install required packages
+RUN apk add --no-cache \
+    bash \
+    su-exec
+
+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 -D "${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 \
+    && apk add --no-cache --virtual .build-deps \
+        gnupg \
+        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 \
+    && apk del .build-deps
+
+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}"]
+
+EXPOSE ${BK_BUILD_PORT}/tcp
+
+COPY run.sh healthcheck.sh /opt/
+
+ENTRYPOINT [ "/bin/bash", "/opt/run.sh" ]
+CMD ["bookkeeper", "bookie"]
 
 Review comment:
   @caiok - here is the snippet you asked for (from my local Dockerfile)
   CMD /bookkeeper/bookkeeper-server/bin/bookkeeper shell bookieformat 
-nonInteractive -force -deleteCookie; /bookkeeper/bookkeeper-server/bin/    
bookkeeper bookie; /bookkeeper/bookkeeper-server/bin/bookkeeper autorecovery
 
----------------------------------------------------------------
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