Created
June 14, 2016 21:15
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e980bb7459865abcb47067b8daed49953704f4fc | |
Author: Robert Newson <rnewson@apache.org> | |
Date: Tue Jun 14 11:59:09 2016 +0100 | |
Build small container for single node | |
diff --git a/Dockerfile.build b/Dockerfile.build | |
new file mode 100644 | |
index 0000000..28a9ba5 | |
--- /dev/null | |
+++ b/Dockerfile.build | |
@@ -0,0 +1,29 @@ | |
+FROM debian:jessie | |
+ENV DEBIAN_FRONTEND noninteractive | |
+MAINTAINER Robert Newson <rnewson@apache.org> | |
+ | |
+# Install prereqs | |
+RUN apt-get -qq update && \ | |
+ apt-get --no-install-recommends -y install \ | |
+ build-essential \ | |
+ ca-certificates \ | |
+ erlang \ | |
+ erlang-eunit \ | |
+ erlang-os-mon \ | |
+ erlang-reltool \ | |
+ erlang-syntax-tools \ | |
+ erlang-tools \ | |
+ erlang-xmerl \ | |
+ git \ | |
+ libicu-dev \ | |
+ libmozjs185-dev \ | |
+ openssl | |
+ | |
+# Fetch | |
+RUN git clone https://git-wip-us.apache.org/repos/asf/couchdb.git | |
+ | |
+# Build | |
+WORKDIR couchdb | |
+RUN ./configure --disable-docs --disable-fauxton | |
+RUN make build | |
+ | |
diff --git a/Dockerfile.release b/Dockerfile.release | |
new file mode 100644 | |
index 0000000..95c0bd9 | |
--- /dev/null | |
+++ b/Dockerfile.release | |
@@ -0,0 +1,23 @@ | |
+FROM scratch | |
+MAINTAINER Robert Newson <rnewson@apache.org> | |
+ | |
+# Add CouchDB | |
+ADD export/couchdb/rel/couchdb /opt/couchdb | |
+ | |
+# Add supporting libraries | |
+ADD export/lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/ | |
+ADD export/lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/ | |
+ADD export/lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/ | |
+ADD export/lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/ | |
+ADD export/lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/ | |
+ADD export/lib/x86_64-linux-gnu/librt.so.1 /lib/x86_64-linux-gnu/ | |
+#ADD export/lib64/ld-linux-x86-64.so.2 /lib64/ | |
+ADD export/usr/lib/x86_64-linux-gnu/libffi.so.6 /usr/lib/x86_64-linux-gnu/ | |
+ADD export/usr/lib/x86_64-linux-gnu/libnspr4.so /usr/lib/x86_64-linux-gnu/ | |
+ADD export/usr/lib/x86_64-linux-gnu/libplc4.so /usr/lib/x86_64-linux-gnu/ | |
+ADD export/usr/lib/x86_64-linux-gnu/libplds4.so /usr/lib/x86_64-linux-gnu/ | |
+ADD export/usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/ | |
+ADD export/usr/lib/libmozjs185.so.1.0 /usr/lib/ | |
+ | |
+EXPOSE 5984 | |
+ENTRYPOINT ["/opt/couchdb/bin/couchdb"] | |
diff --git a/Makefile b/Makefile | |
index 838165c..7011387 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -180,20 +180,11 @@ dialyze: .rebar | |
.PHONY: docker-image | |
# target: docker-image - Build Docker image | |
docker-image: | |
- @docker build --rm -t couchdb/dev-cluster . | |
- | |
- | |
-.PHONY: docker-start | |
-# target: docker-start - Start CouchDB in Docker container | |
-docker-start: | |
- @docker run -d -P -t couchdb/dev-cluster > .docker-id | |
- | |
- | |
-.PHONY: docker-stop | |
-# target: docker-stop - Stop Docker container | |
-docker-stop: | |
- @docker stop `cat .docker-id` | |
- | |
+ @docker build --rm --tag=couchdb/build -f Dockerfile.build . | |
+ @docker create --name couchdb-tmp couchdb/build | |
+ @docker export -o couchdb-build.tar.gz couchdb-tmp | |
+ @docker rm couchdb-tmp | |
+ @docker build --rm --tag=couchdb/release -f Dockerfile.release . | |
.PHONY: introspect | |
# target: introspect - Check for commits difference between rebar.config and repository |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment