Skip to content

Commit 51210fc

Browse files
authored
Merge pull request #6 from redgeoff/2.1
feat(couchdb): upgrade to 2.1
2 parents 7186f4f + 6c36688 commit 51210fc

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

Dockerfile

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Credit: this work is heavily based on https://github.com/apache/couchdb-docker/blob/master/2.0.0/Dockerfile
22

3-
# We use ubuntu instead of debian:jessie as we want Erlang >= 18 for Couchdb SSL support
3+
# We use ubuntu instead of debian:jessie as we want Erlang >= 18 for CouchDB SSL support
44
FROM ubuntu
55

66
MAINTAINER Geoff Cox redgeoff@gmail.com
@@ -17,15 +17,25 @@ RUN apt-get --no-install-recommends -y install \
1717
openssl \
1818
curl
1919

20+
# Update package lists
21+
RUN apt-get update -y -qq
22+
23+
# The certs need to be installed after we have updated the package lists
24+
RUN apt-get --no-install-recommends -y install \
25+
ca-certificates
26+
2027
# TODO: Installing nodejs adds almost 300 MB to our image! Even the official node image
2128
# (https://hub.docker.com/_/node/) is 666 MB. Is the best solution to eventually rewrite
2229
# docker-discover-tasks in lower level language like c++?
2330
#
2431
# Install nodejs
25-
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - \
26-
&& apt-get install -y nodejs npm \
27-
&& npm install npm -g \
28-
&& ln -s /usr/bin/nodejs /usr/bin/node
32+
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
33+
&& apt-get install -y nodejs \
34+
&& npm install npm -g
35+
36+
# Assuming the build process stays the same, you should be able to just change value of
37+
# COUCHDB_VERSION to upgrade to the latest source
38+
ENV COUCHDB_VERSION 2.1.0
2939

3040
# Download CouchDB, build it and then clean up
3141
RUN buildDeps=" \
@@ -39,10 +49,10 @@ RUN buildDeps=" \
3949
" \
4050
&& apt-get --no-install-recommends -y install $buildDeps \
4151
&& cd /usr/src \
42-
&& wget http://www-eu.apache.org/dist/couchdb/source/2.0.0/apache-couchdb-2.0.0.tar.gz \
43-
&& tar xfz apache-couchdb-2.0.0.tar.gz \
44-
&& rm apache-couchdb-2.0.0.tar.gz \
45-
&& cd apache-couchdb-2.0.0 \
52+
&& wget http://www-us.apache.org/dist/couchdb/source/$COUCHDB_VERSION/apache-couchdb-$COUCHDB_VERSION.tar.gz \
53+
&& tar xfz apache-couchdb-$COUCHDB_VERSION.tar.gz \
54+
&& rm apache-couchdb-$COUCHDB_VERSION.tar.gz \
55+
&& cd apache-couchdb-$COUCHDB_VERSION \
4656
&& ./configure \
4757
&& make release \
4858
&& adduser --system \
@@ -51,10 +61,7 @@ RUN buildDeps=" \
5161
"CouchDB Administrator" couchdb \
5262
&& mv ./rel/couchdb /home/couchdb \
5363
&& cd ../ \
54-
&& rm -rf apache-couchdb-2.0.0 \
55-
&& chown -R couchdb:couchdb /home/couchdb/couchdb \
56-
&& find /home/couchdb/couchdb -type d -exec chmod 0770 {} \; \
57-
&& chmod 0644 /home/couchdb/couchdb/etc/* \
64+
&& rm -rf apache-couchdb-$COUCHDB_VERSION \
5865
&& apt-get purge -y --auto-remove $buildDeps \
5966
&& rm -rf /var/lib/apt/lists/*
6067

@@ -63,7 +70,10 @@ COPY local.ini /home/couchdb/couchdb/etc/local.d/
6370
COPY vm.args /home/couchdb/couchdb/etc/
6471

6572
# Set up directories and permissions
66-
RUN mkdir /home/couchdb/couchdb/data /home/couchdb/couchdb/etc/default.d \
73+
RUN mkdir -p /home/couchdb/couchdb/data /home/couchdb/couchdb/etc/default.d \
74+
&& find /home/couchdb/couchdb -type d -exec chmod 0770 {} \; \
75+
&& chmod 0644 /home/couchdb/couchdb/etc/* \
76+
&& chmod 775 /home/couchdb/couchdb/etc/*.d \
6777
&& chown -R couchdb:couchdb /home/couchdb/couchdb/
6878

6979
# docker-discover-tasks allows the nodes to discover each other

0 commit comments

Comments
 (0)