You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2018/04/11 17:36:10 UTC
[couchdb-docker] branch master updated (fd69b25 -> 45b9dd1)
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git.
from fd69b25 Improve README for configuration changes, closes #47
new c3ddd60 Rename dev to dev-cluster
new b273424 Introduce developer-friendly Dockerfile
new 42de4b0 Install newer RTD theme from pip
new 7efafe2 Add new targets to .travis.yml CI/CD
new 45b9dd1 Further fixes for dev and dev-cluster targets
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.travis.yml | 15 +--
dev-cluster/Dockerfile | 125 +++++++++++++++++++
dev/Dockerfile | 173 ++++++++++++++++++---------
{2.1.1 => dev}/docker-entrypoint.sh | 15 ++-
2.1.1/10-docker-default.ini => dev/local.ini | 0
{2.1.1 => dev}/vm.args | 0
6 files changed, 256 insertions(+), 72 deletions(-)
create mode 100644 dev-cluster/Dockerfile
copy {2.1.1 => dev}/docker-entrypoint.sh (83%)
copy 2.1.1/10-docker-default.ini => dev/local.ini (100%)
copy {2.1.1 => dev}/vm.args (100%)
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.
[couchdb-docker] 02/05: Introduce developer-friendly Dockerfile
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit b2734247ac8df0c0f1d51f3ba5464db60fef8e13
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Mon Jan 15 20:41:08 2018 -0500
Introduce developer-friendly Dockerfile
This dev image configuration is modeled after the 2.1.1 Dockerfile with
a few modifications useful for day-to-day development:
* The Dockerfile builds from git rather than the official source
releases. The build is configurable using the following build_args:
clone_url (default: https://gitbox.apache.org/repos/asf/couchdb.git)
checkout_branch (default: master)
configure_options (default: <blank>)
The configure_options are passed directly to ./configure and can be
used to e.g. --disable-docs or --disable-fauxton:
docker build --build-arg checkout_branch=my-cool-feature dev/
* We take advantage of multi-stage builds [1] to create a series of
layers that optimize build time without inflating the final image
size. In normal development the layers that install runtime and
build dependencies will be cached, and the build will start by
updating and configuring the existing git clone.
This work includes the changes proposed in #50 and #57.
---
dev/Dockerfile | 136 +++++++++++++++++++++++++++++++++++++++++++++++
dev/docker-entrypoint.sh | 74 ++++++++++++++++++++++++++
dev/local.ini | 11 ++++
dev/vm.args | 28 ++++++++++
4 files changed, 249 insertions(+)
diff --git a/dev/Dockerfile b/dev/Dockerfile
new file mode 100644
index 0000000..336ab80
--- /dev/null
+++ b/dev/Dockerfile
@@ -0,0 +1,136 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+# Base layer containing dependencies needed at runtime. This layer will be
+# cached after the initial build.
+FROM debian:jessie AS runtime
+
+LABEL maintainer="CouchDB Developers <de...@couchdb.apache.org>"
+
+# Add CouchDB user account
+RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
+
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
+ ca-certificates \
+ libicu52 \
+ libmozjs185-1.0 \
+ openssl \
+ && rm -rf /var/lib/apt/lists/*
+
+# grab gosu for easy step-down from root and tini for signal handling
+# see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407
+ENV GOSU_VERSION 1.10
+ENV TINI_VERSION 0.16.1
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends wget; \
+ rm -rf /var/lib/apt/lists/*; \
+ \
+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
+ \
+# install gosu
+ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
+ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
+ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+ chmod +x /usr/local/bin/gosu; \
+ gosu nobody true; \
+ \
+# install tini
+ wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
+ wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7; \
+ gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
+ rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \
+ chmod +x /usr/local/bin/tini; \
+ tini --version; \
+ \
+ apt-get purge -y --auto-remove wget
+
+# Dependencies only needed during build time. This layer will also be cached
+# unless for each clone_url.
+FROM runtime AS build_dependencies
+
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
+ apt-transport-https \
+ gcc \
+ g++ \
+ curl \
+ erlang-nox \
+ erlang-reltool \
+ erlang-dev \
+ git \
+ libcurl4-openssl-dev \
+ libicu-dev \
+ libmozjs185-dev \
+ make \
+ python \
+ python-sphinx \
+ python-sphinx-rtd-theme \
+ texinfo \
+ texlive-base \
+ texlive-fonts-extra \
+ texlive-fonts-recommended \
+ texlive-latex-extra
+
+# Node is special
+RUN set -ex; \
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
+ echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' >> /etc/apt/sources.list.d/nodesource.list; \
+ apt-get update -y && apt-get install -y nodejs; \
+ npm install -g grunt-cli
+
+
+# Clone CouchDB source code including all dependencies
+ARG clone_url=https://gitbox.apache.org/repos/asf/couchdb.git
+RUN git clone $clone_url /usr/src/couchdb
+WORKDIR /usr/src/couchdb
+RUN ./configure
+
+# This layer performs the actual build of a relocatable, self-contained
+# release of CouchDB. It pulls down the latest changes from the remote
+# origin (because the layer above will be cached) and switches to the
+# branch specified in the build_arg (defaults to master)
+FROM build_dependencies AS build
+
+ARG checkout_branch=master
+ARG configure_options
+
+WORKDIR /usr/src/couchdb/
+RUN git fetch origin \
+ && git checkout $checkout_branch \
+ && ./configure $configure_options \
+ && make release
+
+# This results in a single layer image (or at least skips the build stuff?)
+FROM runtime
+COPY --from=build /usr/src/couchdb/rel/couchdb /opt/
+
+# Add configuration
+COPY local.ini /opt/couchdb/etc/default.d/
+COPY vm.args /opt/couchdb/etc/
+COPY docker-entrypoint.sh /
+
+# Setup directories and permissions
+RUN chown -R couchdb:couchdb /opt/couchdb/etc/default.d/ /opt/couchdb/etc/vm.args
+
+WORKDIR /opt/couchdb
+EXPOSE 5984 4369 9100
+VOLUME ["/opt/couchdb/data"]
+
+ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
+CMD ["/opt/couchdb/bin/couchdb"]
diff --git a/dev/docker-entrypoint.sh b/dev/docker-entrypoint.sh
new file mode 100755
index 0000000..dda823d
--- /dev/null
+++ b/dev/docker-entrypoint.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+set -e
+
+# first arg is `-something` or `+something`
+if [ "${1#-}" != "$1" ] || [ "${1#+}" != "$1" ]; then
+ set -- /opt/couchdb/bin/couchdb "$@"
+fi
+
+# first arg is the bare word `couchdb`
+if [ "$1" = 'couchdb' ]; then
+ shift
+ set -- /opt/couchdb/bin/couchdb "$@"
+fi
+
+if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
+ # we need to set the permissions here because docker mounts volumes as root
+ chown -R couchdb:couchdb /opt/couchdb
+
+ chmod -R 0770 /opt/couchdb/data
+
+ chmod 664 /opt/couchdb/etc/*.ini
+ chmod 664 /opt/couchdb/etc/local.d/*.ini
+ chmod 775 /opt/couchdb/etc/*.d
+
+ if [ ! -z "$NODENAME" ] && ! grep "couchdb@" /opt/couchdb/etc/vm.args; then
+ echo "-name couchdb@$NODENAME" >> /opt/couchdb/etc/vm.args
+ fi
+
+ if [ "$COUCHDB_USER" ] && [ "$COUCHDB_PASSWORD" ]; then
+ # Create admin
+ printf "[admins]\n%s = %s\n" "$COUCHDB_USER" "$COUCHDB_PASSWORD" > /opt/couchdb/etc/local.d/docker.ini
+ chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ fi
+
+ if [ "$COUCHDB_SECRET" ]; then
+ # Set secret
+ printf "[couch_httpd_auth]\nsecret = %s\n" "$COUCHDB_SECRET" >> /opt/couchdb/etc/local.d/docker.ini
+ chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ fi
+
+ # if we don't find an [admins] section followed by a non-comment, display a warning
+ if ! grep -Pzoqr '\[admins\]\n[^;]\w+' /opt/couchdb/etc/local.d/*.ini; then
+ # The - option suppresses leading tabs but *not* spaces. :)
+ cat >&2 <<-'EOWARN'
+ ****************************************************
+ WARNING: CouchDB is running in Admin Party mode.
+ This will allow anyone with access to the
+ CouchDB port to access your database. In
+ Docker's default configuration, this is
+ effectively any other container on the same
+ system.
+ Use "-e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password"
+ to set it in "docker run".
+ ****************************************************
+ EOWARN
+ fi
+
+
+ exec gosu couchdb "$@"
+fi
+
+exec "$@"
diff --git a/dev/local.ini b/dev/local.ini
new file mode 100644
index 0000000..c1bac9e
--- /dev/null
+++ b/dev/local.ini
@@ -0,0 +1,11 @@
+; CouchDB Configuration Settings
+
+; Custom settings should be made in this file. They will override settings
+; in default.ini, but unlike changes made to default.ini, this file won't be
+; overwritten on server upgrade.
+
+[chttpd]
+bind_address = any
+
+[httpd]
+bind_address = any
diff --git a/dev/vm.args b/dev/vm.args
new file mode 100644
index 0000000..0425756
--- /dev/null
+++ b/dev/vm.args
@@ -0,0 +1,28 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+# Ensure that the Erlang VM listens on a known port
+-kernel inet_dist_listen_min 9100
+-kernel inet_dist_listen_max 9100
+
+# Tell kernel and SASL not to log anything
+-kernel error_logger silent
+-sasl sasl_error_logger false
+
+# Use kernel poll functionality if supported by emulator
++K true
+
+# Start a pool of asynchronous IO threads
++A 16
+
+# Comment this line out to enable the interactive Erlang shell on startup
++Bd -noinput
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.
[couchdb-docker] 05/05: Further fixes for dev and dev-cluster
targets
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit 45b9dd1cc3ae1449f47cde77481b7f49173a1d9d
Author: Joan Touzet <jo...@atypical.net>
AuthorDate: Wed Apr 11 03:37:43 2018 -0400
Further fixes for dev and dev-cluster targets
---
dev-cluster/Dockerfile | 107 +++++++++++++++++++++++------------------------
dev/Dockerfile | 91 +++++++++++++++++++++-------------------
dev/docker-entrypoint.sh | 13 +++---
3 files changed, 106 insertions(+), 105 deletions(-)
diff --git a/dev-cluster/Dockerfile b/dev-cluster/Dockerfile
index 0166050..c89c104 100644
--- a/dev-cluster/Dockerfile
+++ b/dev-cluster/Dockerfile
@@ -12,63 +12,69 @@
# Base layer containing dependencies needed at runtime. This layer will be
# cached after the initial build.
-FROM debian:jessie AS runtime
+FROM debian:stretch
-LABEL maintainer="CouchDB Developers <de...@couchdb.apache.org>"
+MAINTAINER CouchDB Developers dev@couchdb.apache.org
# Add CouchDB user account
RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates \
- libicu52 \
+ curl \
+ dirmngr \
+ gnupg \
+ haproxy \
+ libicu57 \
libmozjs185-1.0 \
openssl \
- && rm -rf /var/lib/apt/lists/*
+ python && \
+ rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root and tini for signal handling
# see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407
ENV GOSU_VERSION 1.10
ENV TINI_VERSION 0.16.1
RUN set -ex; \
- \
- apt-get update; \
- apt-get install -y --no-install-recommends wget; \
- rm -rf /var/lib/apt/lists/*; \
- \
- dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
- \
+ apt-get update; \
+ apt-get install -y --no-install-recommends wget; \
+ rm -rf /var/lib/apt/lists/*; \
+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
# install gosu
- wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
- wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
- export GNUPGHOME="$(mktemp -d)"; \
- gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
- gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
- rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
- chmod +x /usr/local/bin/gosu; \
- gosu nobody true; \
- \
+ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
+ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ for server in $(shuf -e ha.pool.sks-keyservers.net \
+ hkp://p80.pool.sks-keyservers.net:80 \
+ keyserver.ubuntu.com \
+ hkp://keyserver.ubuntu.com:80 \
+ pgp.mit.edu) ; do \
+ gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
+ done; \
+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
+ rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+ chmod +x /usr/local/bin/gosu; \
+ gosu nobody true; \
# install tini
- wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
- wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
- export GNUPGHOME="$(mktemp -d)"; \
- gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7; \
- gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
- rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \
- chmod +x /usr/local/bin/tini; \
- tini --version; \
- \
- apt-get purge -y --auto-remove wget
-
-# Dependencies only needed during build time. This layer will also be cached
-# unless for each clone_url.
-FROM runtime AS build_dependencies
+ wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
+ wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ for server in $(shuf -e ha.pool.sks-keyservers.net \
+ hkp://p80.pool.sks-keyservers.net:80 \
+ keyserver.ubuntu.com \
+ hkp://keyserver.ubuntu.com:80 \
+ pgp.mit.edu) ; do \
+ gpg --keyserver "$server" --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 && break || : ; \
+ done; \
+ gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
+ rm -rf "$GNUPGHOME" /usr/local/bin/tini.asc; \
+ chmod +x /usr/local/bin/tini; \
+ tini --version; \
+ apt-get purge -y --auto-remove wget
RUN apt-get update -y && apt-get install -y --no-install-recommends \
apt-transport-https \
- gcc \
- g++ \
- curl \
+ build-essential \
erlang-nox \
erlang-reltool \
erlang-dev \
@@ -76,9 +82,9 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libicu-dev \
libmozjs185-dev \
- make \
- python \
- python-pip
+ python-setuptools \
+ python-pip \
+ python-wheel
RUN pip install \
sphinx \
@@ -87,8 +93,8 @@ RUN pip install \
# Node is special
RUN set -ex; \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
- echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list; \
- echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' >> /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb https://deb.nodesource.com/node_6.x stretch main' > /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb-src https://deb.nodesource.com/node_6.x stretch main' >> /etc/apt/sources.list.d/nodesource.list; \
apt-get update -y && apt-get install -y nodejs; \
npm install -g grunt-cli
@@ -99,28 +105,21 @@ RUN git clone $clone_url /usr/src/couchdb
WORKDIR /usr/src/couchdb
RUN ./configure
-# This layer performs the actual build of a relocatable, self-contained
-# release of CouchDB. It pulls down the latest changes from the remote
-# origin (because the layer above will be cached) and switches to the
-# branch specified in the build_arg (defaults to master)
-FROM build_dependencies AS build
-
ARG checkout_branch=master
ARG configure_options
-WORKDIR /usr/src/couchdb
+WORKDIR /usr/src/couchdb/
RUN git fetch origin \
&& git checkout $checkout_branch \
&& ./configure $configure_options \
- && make couch
-
-# we skip any finalisation of this image since this is purely for testing
+ && make all
# Setup directories and permissions
RUN chown -R couchdb:couchdb /usr/src/couchdb
-WORKDIR /usr/src/couchdb
-EXPOSE 5984 4369 9100
+WORKDIR /opt/couchdb
+EXPOSE 5984 15984 25984 35984
+VOLUME ["/usr/src/couchdb/dev/lib"]
ENTRYPOINT ["tini", "--", "/usr/src/couchdb/dev/run"]
CMD ["--with-haproxy"]
diff --git a/dev/Dockerfile b/dev/Dockerfile
index ba3e259..1b43ba7 100644
--- a/dev/Dockerfile
+++ b/dev/Dockerfile
@@ -12,63 +12,71 @@
# Base layer containing dependencies needed at runtime. This layer will be
# cached after the initial build.
-FROM debian:jessie AS runtime
+FROM debian:stretch as runtime
-LABEL maintainer="CouchDB Developers <de...@couchdb.apache.org>"
+MAINTAINER CouchDB Developers dev@couchdb.apache.org
# Add CouchDB user account
RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates \
- libicu52 \
+ curl \
+ dirmngr \
+ gnupg \
+ libicu57 \
libmozjs185-1.0 \
openssl \
- && rm -rf /var/lib/apt/lists/*
+ python && \
+ rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root and tini for signal handling
# see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407
ENV GOSU_VERSION 1.10
ENV TINI_VERSION 0.16.1
RUN set -ex; \
- \
- apt-get update; \
- apt-get install -y --no-install-recommends wget; \
- rm -rf /var/lib/apt/lists/*; \
- \
- dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
- \
+ apt-get update; \
+ apt-get install -y --no-install-recommends wget; \
+ rm -rf /var/lib/apt/lists/*; \
+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
# install gosu
- wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
- wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
- export GNUPGHOME="$(mktemp -d)"; \
- gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
- gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
- rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
- chmod +x /usr/local/bin/gosu; \
- gosu nobody true; \
- \
+ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
+ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ for server in $(shuf -e ha.pool.sks-keyservers.net \
+ hkp://p80.pool.sks-keyservers.net:80 \
+ keyserver.ubuntu.com \
+ hkp://keyserver.ubuntu.com:80 \
+ pgp.mit.edu) ; do \
+ gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
+ done; \
+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
+ rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+ chmod +x /usr/local/bin/gosu; \
+ gosu nobody true; \
# install tini
- wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
- wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
- export GNUPGHOME="$(mktemp -d)"; \
- gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7; \
- gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
- rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \
- chmod +x /usr/local/bin/tini; \
- tini --version; \
- \
- apt-get purge -y --auto-remove wget
+ wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
+ wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ for server in $(shuf -e ha.pool.sks-keyservers.net \
+ hkp://p80.pool.sks-keyservers.net:80 \
+ keyserver.ubuntu.com \
+ hkp://keyserver.ubuntu.com:80 \
+ pgp.mit.edu) ; do \
+ gpg --keyserver "$server" --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 && break || : ; \
+ done; \
+ gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
+ rm -rf "$GNUPGHOME" /usr/local/bin/tini.asc; \
+ chmod +x /usr/local/bin/tini; \
+ tini --version; \
+ apt-get purge -y --auto-remove wget
# Dependencies only needed during build time. This layer will also be cached
-# unless for each clone_url.
FROM runtime AS build_dependencies
RUN apt-get update -y && apt-get install -y --no-install-recommends \
apt-transport-https \
- gcc \
- g++ \
- curl \
+ build-essential \
erlang-nox \
erlang-reltool \
erlang-dev \
@@ -76,14 +84,9 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libicu-dev \
libmozjs185-dev \
- make \
- python \
+ python-setuptools \
python-pip \
- texinfo \
- texlive-base \
- texlive-fonts-extra \
- texlive-fonts-recommended \
- texlive-latex-extra
+ python-wheel
RUN pip install \
sphinx \
@@ -92,8 +95,8 @@ RUN pip install \
# Node is special
RUN set -ex; \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
- echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list; \
- echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' >> /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb https://deb.nodesource.com/node_6.x stretch main' > /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb-src https://deb.nodesource.com/node_6.x stretch main' >> /etc/apt/sources.list.d/nodesource.list; \
apt-get update -y && apt-get install -y nodejs; \
npm install -g grunt-cli
@@ -121,7 +124,7 @@ RUN git fetch origin \
# This results in a single layer image (or at least skips the build stuff?)
FROM runtime
-COPY --from=build /usr/src/couchdb/rel/couchdb /opt/
+COPY --from=build /usr/src/couchdb/rel/couchdb /opt/couchdb
# Add configuration
COPY local.ini /opt/couchdb/etc/default.d/
diff --git a/dev/docker-entrypoint.sh b/dev/docker-entrypoint.sh
index dda823d..718779e 100755
--- a/dev/docker-entrypoint.sh
+++ b/dev/docker-entrypoint.sh
@@ -26,13 +26,12 @@ fi
if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
# we need to set the permissions here because docker mounts volumes as root
- chown -R couchdb:couchdb /opt/couchdb
+ chown -fR couchdb:couchdb /opt/couchdb || true
- chmod -R 0770 /opt/couchdb/data
+ chmod -fR 0770 /opt/couchdb/data || true
- chmod 664 /opt/couchdb/etc/*.ini
- chmod 664 /opt/couchdb/etc/local.d/*.ini
- chmod 775 /opt/couchdb/etc/*.d
+ find /opt/couchdb/etc -name \*.ini -exec chmod -f 664 {} \;
+ chmod -f 775 /opt/couchdb/etc/*.d || true
if [ ! -z "$NODENAME" ] && ! grep "couchdb@" /opt/couchdb/etc/vm.args; then
echo "-name couchdb@$NODENAME" >> /opt/couchdb/etc/vm.args
@@ -41,13 +40,13 @@ if [ "$1" = '/opt/couchdb/bin/couchdb' ]; then
if [ "$COUCHDB_USER" ] && [ "$COUCHDB_PASSWORD" ]; then
# Create admin
printf "[admins]\n%s = %s\n" "$COUCHDB_USER" "$COUCHDB_PASSWORD" > /opt/couchdb/etc/local.d/docker.ini
- chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ chown -f couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini || true
fi
if [ "$COUCHDB_SECRET" ]; then
# Set secret
printf "[couch_httpd_auth]\nsecret = %s\n" "$COUCHDB_SECRET" >> /opt/couchdb/etc/local.d/docker.ini
- chown couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini
+ chown -f couchdb:couchdb /opt/couchdb/etc/local.d/docker.ini || true
fi
# if we don't find an [admins] section followed by a non-comment, display a warning
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.
[couchdb-docker] 01/05: Rename dev to dev-cluster
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit c3ddd601338fc579c576ea40e8668d88f4306412
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sat Jan 13 22:28:45 2018 -0500
Rename dev to dev-cluster
This paves the way for a simpler dev image Dockerfile.
---
{dev => dev-cluster}/Dockerfile | 0
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/dev/Dockerfile b/dev-cluster/Dockerfile
similarity index 100%
rename from dev/Dockerfile
rename to dev-cluster/Dockerfile
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.
[couchdb-docker] 04/05: Add new targets to .travis.yml CI/CD
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit 7efafe23c03af436cdfcc43b71d91441ef01615e
Author: Joan Touzet <jo...@atypical.net>
AuthorDate: Mon Apr 9 11:50:43 2018 -0400
Add new targets to .travis.yml CI/CD
---
.travis.yml | 15 ++---
dev-cluster/Dockerfile | 155 +++++++++++++++++++++++++++++++------------------
2 files changed, 107 insertions(+), 63 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 8ac681d..7db5791 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,12 +3,13 @@ sudo: required
services:
- docker
-before_install:
- - docker build -t couchdb:1.7.1 1.7.1
- - docker build -t couchdb:1.7.1-couchperuser 1.7.1-couchperuser
- - docker build -t couchdb:2.1.1 2.1.1
+env:
+ - RELEASE=1.7.1
+ - RELEASE=1.7.1-couchperuser
+ - RELEASE=2.1.1
+ - RELEASE=dev
+ - RELEASE=dev-cluster
script:
- - docker run -d -p 5984:5984 couchdb:1.7.1 && sleep 5 && curl http://localhost:5984
- - docker run -d -p 5985:5984 couchdb:1.7.1-couchperuser && sleep 5 && curl http://localhost:5985
- - docker run -d -p 5986:5984 couchdb:2.1.1 && sleep 5 && curl http://localhost:5986
+ - docker build -t couchdb:$RELEASE $RELEASE
+ - docker run -d -p 5984:5984 couchdb:$RELEASE && sleep 10 && curl http://localhost:5984
diff --git a/dev-cluster/Dockerfile b/dev-cluster/Dockerfile
index 8b4a733..0166050 100644
--- a/dev-cluster/Dockerfile
+++ b/dev-cluster/Dockerfile
@@ -10,74 +10,117 @@
# License for the specific language governing permissions and limitations under
# the License.
-FROM debian:jessie
+# Base layer containing dependencies needed at runtime. This layer will be
+# cached after the initial build.
+FROM debian:jessie AS runtime
-MAINTAINER CouchDB Developers dev@couchdb.apache.org
+LABEL maintainer="CouchDB Developers <de...@couchdb.apache.org>"
-ENV COUCHDB_VERSION master
+# Add CouchDB user account
+RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb
-RUN groupadd -g 5984 -r couchdb && useradd -u 5984 -d /opt/couchdb -g couchdb couchdb
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
+ ca-certificates \
+ libicu52 \
+ libmozjs185-1.0 \
+ openssl \
+ && rm -rf /var/lib/apt/lists/*
+
+# grab gosu for easy step-down from root and tini for signal handling
+# see https://github.com/apache/couchdb-docker/pull/28#discussion_r141112407
+ENV GOSU_VERSION 1.10
+ENV TINI_VERSION 0.16.1
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends wget; \
+ rm -rf /var/lib/apt/lists/*; \
+ \
+ dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
+ \
+# install gosu
+ wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$dpkgArch"; \
+ wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
+ gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
+ rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+ chmod +x /usr/local/bin/gosu; \
+ gosu nobody true; \
+ \
+# install tini
+ wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch"; \
+ wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$dpkgArch.asc"; \
+ export GNUPGHOME="$(mktemp -d)"; \
+ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7; \
+ gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini; \
+ rm -r "$GNUPGHOME" /usr/local/bin/tini.asc; \
+ chmod +x /usr/local/bin/tini; \
+ tini --version; \
+ \
+ apt-get purge -y --auto-remove wget
+
+# Dependencies only needed during build time. This layer will also be cached
+# unless for each clone_url.
+FROM runtime AS build_dependencies
-# download dependencies
-RUN apt-get update -y -qq && apt-get install -y --no-install-recommends \
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
apt-transport-https \
- build-essential \
- ca-certificates \
+ gcc \
+ g++ \
curl \
- default-jdk \
- erlang-dev \
erlang-nox \
+ erlang-reltool \
+ erlang-dev \
git \
- haproxy \
libcurl4-openssl-dev \
libicu-dev \
libmozjs185-dev \
- libwxgtk3.0 \
- openssl \
- pkg-config \
- python \
- python-sphinx \
- texinfo \
- texlive-base \
- texlive-fonts-extra \
- texlive-fonts-recommended \
- texlive-latex-extra \
- && curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
- && echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list \
- && echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' >> /etc/apt/sources.list.d/nodesource.list \
- && apt-get update -y -qq && apt-get install -y nodejs \
- && npm install -g grunt-cli \
- && cd /usr/src && git clone https://gitbox.apache.org/repos/asf/couchdb.git \
- && cd couchdb && git checkout $COUCHDB_VERSION \
- && cd /usr/src/couchdb && ./configure && make \
- && apt-get purge -y \
- binutils \
- build-essential \
- cpp \
- default-jdk \
- git \
- libcurl4-openssl-dev \
- libicu-dev \
- libwxgtk3.0 \
make \
- nodejs \
- perl \
- pkg-config \
- texinfo \
- texlive-base \
- texlive-fonts-extra \
- texlive-fonts-recommended \
- texlive-latex-extra \
- && apt-get autoremove -y \
- && apt-get install -y libicu52 --no-install-recommends \
- && rm -rf /var/lib/apt/lists/* /usr/lib/node_modules src/fauxton/node_modules src/**/.git .git
-
-# permissions
-RUN chmod +x /usr/src/couchdb/dev/run && chown -R couchdb:couchdb /usr/src/couchdb
-
-USER couchdb
-EXPOSE 5984 15984 25984 35984 15986 25986 35986
+ python \
+ python-pip
+
+RUN pip install \
+ sphinx \
+ sphinx_rtd_theme
+
+# Node is special
+RUN set -ex; \
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
+ echo 'deb https://deb.nodesource.com/node_6.x jessie main' > /etc/apt/sources.list.d/nodesource.list; \
+ echo 'deb-src https://deb.nodesource.com/node_6.x jessie main' >> /etc/apt/sources.list.d/nodesource.list; \
+ apt-get update -y && apt-get install -y nodejs; \
+ npm install -g grunt-cli
+
+
+# Clone CouchDB source code including all dependencies
+ARG clone_url=https://gitbox.apache.org/repos/asf/couchdb.git
+RUN git clone $clone_url /usr/src/couchdb
+WORKDIR /usr/src/couchdb
+RUN ./configure
+
+# This layer performs the actual build of a relocatable, self-contained
+# release of CouchDB. It pulls down the latest changes from the remote
+# origin (because the layer above will be cached) and switches to the
+# branch specified in the build_arg (defaults to master)
+FROM build_dependencies AS build
+
+ARG checkout_branch=master
+ARG configure_options
+
+WORKDIR /usr/src/couchdb
+RUN git fetch origin \
+ && git checkout $checkout_branch \
+ && ./configure $configure_options \
+ && make couch
+
+# we skip any finalisation of this image since this is purely for testing
+
+# Setup directories and permissions
+RUN chown -R couchdb:couchdb /usr/src/couchdb
+
WORKDIR /usr/src/couchdb
+EXPOSE 5984 4369 9100
-ENTRYPOINT ["/usr/src/couchdb/dev/run"]
+ENTRYPOINT ["tini", "--", "/usr/src/couchdb/dev/run"]
CMD ["--with-haproxy"]
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.
[couchdb-docker] 03/05: Install newer RTD theme from pip
Posted by wo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-docker.git
commit 42de4b02ff99684c75fcbe006d636ddaa2e80f9b
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Wed Jan 17 13:21:06 2018 -0500
Install newer RTD theme from pip
See #58
---
dev/Dockerfile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dev/Dockerfile b/dev/Dockerfile
index 336ab80..ba3e259 100644
--- a/dev/Dockerfile
+++ b/dev/Dockerfile
@@ -78,14 +78,17 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
libmozjs185-dev \
make \
python \
- python-sphinx \
- python-sphinx-rtd-theme \
+ python-pip \
texinfo \
texlive-base \
texlive-fonts-extra \
texlive-fonts-recommended \
texlive-latex-extra
+RUN pip install \
+ sphinx \
+ sphinx_rtd_theme
+
# Node is special
RUN set -ex; \
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -; \
--
To stop receiving notification emails like this one, please contact
wohali@apache.org.