1
1
# Credit: this work is heavily based on https://github.com/apache/couchdb-docker/blob/master/2.0.0/Dockerfile
2
2
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
4
4
FROM ubuntu
5
5
6
6
MAINTAINER Geoff Cox redgeoff@gmail.com
@@ -17,15 +17,25 @@ RUN apt-get --no-install-recommends -y install \
17
17
openssl \
18
18
curl
19
19
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
+
20
27
# TODO: Installing nodejs adds almost 300 MB to our image! Even the official node image
21
28
# (https://hub.docker.com/_/node/) is 666 MB. Is the best solution to eventually rewrite
22
29
# docker-discover-tasks in lower level language like c++?
23
30
#
24
31
# 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
29
39
30
40
# Download CouchDB, build it and then clean up
31
41
RUN buildDeps=" \
@@ -39,10 +49,10 @@ RUN buildDeps=" \
39
49
" \
40
50
&& apt-get --no-install-recommends -y install $buildDeps \
41
51
&& 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 \
46
56
&& ./configure \
47
57
&& make release \
48
58
&& adduser --system \
@@ -51,10 +61,7 @@ RUN buildDeps=" \
51
61
"CouchDB Administrator" couchdb \
52
62
&& mv ./rel/couchdb /home/couchdb \
53
63
&& 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 \
58
65
&& apt-get purge -y --auto-remove $buildDeps \
59
66
&& rm -rf /var/lib/apt/lists/*
60
67
@@ -63,7 +70,10 @@ COPY local.ini /home/couchdb/couchdb/etc/local.d/
63
70
COPY vm.args /home/couchdb/couchdb/etc/
64
71
65
72
# 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 \
67
77
&& chown -R couchdb:couchdb /home/couchdb/couchdb/
68
78
69
79
# docker-discover-tasks allows the nodes to discover each other
0 commit comments