diff --git a/.travis/deploy_docker_rpi.sh b/.travis/deploy_docker_rpi.sh index a64dcce..a50219e 100755 --- a/.travis/deploy_docker_rpi.sh +++ b/.travis/deploy_docker_rpi.sh @@ -67,6 +67,14 @@ build_message Build V212 image started... deploy_v212 build_message Build V212 image finished, check build result! +build_message Build V172 arm64 image started... +deploy_v172_arm64 +build_message Build V172 arm64 image finished, check build result! + +build_message Build V212 arm64 image started... +deploy_v212_arm64 +build_message Build V212 arm64 image finished, check build result! + build_message Preparing to Push multi-arch manifest to Docker Cloud .. deploy_multiarch diff --git a/.travis/multiarch_manifests/multiarch_manifest_latest.yml b/.travis/multiarch_manifests/multiarch_manifest_latest.yml index 6d76f46..7b4a45d 100644 --- a/.travis/multiarch_manifests/multiarch_manifest_latest.yml +++ b/.travis/multiarch_manifests/multiarch_manifest_latest.yml @@ -6,8 +6,12 @@ manifests: architecture: arm os: linux - - image: amd64/couchdb:2.1.2 + image: treehouses/rpi-couchdb:arm64-2.1.2 + platform: + architecture: arm64 + os: linux + - + image: amd64/couchdb:2.1.1 platform: architecture: amd64 os: linux - diff --git a/.travis/multiarch_manifests/multiarch_manifest_v1.7.2.yml b/.travis/multiarch_manifests/multiarch_manifest_v1.7.2.yml index b85cf8d..d434c05 100644 --- a/.travis/multiarch_manifests/multiarch_manifest_v1.7.2.yml +++ b/.travis/multiarch_manifests/multiarch_manifest_v1.7.2.yml @@ -5,6 +5,11 @@ manifests: platform: architecture: arm os: linux + - + image: treehouses/rpi-couchdb:arm64-1.7.2 + platform: + architecture: arm64 + os: linux - image: amd64/couchdb:1.7.2 platform: diff --git a/.travis/multiarch_manifests/multiarch_manifest_v2.1.2.yml b/.travis/multiarch_manifests/multiarch_manifest_v2.1.2.yml index 369e0db..4ab6535 100644 --- a/.travis/multiarch_manifests/multiarch_manifest_v2.1.2.yml +++ b/.travis/multiarch_manifests/multiarch_manifest_v2.1.2.yml @@ -5,6 +5,11 @@ manifests: platform: architecture: arm os: linux + - + image: treehouses/rpi-couchdb:arm64-2.1.2 + platform: + architecture: arm64 + os: linux - image: amd64/couchdb:2.1.2 platform: diff --git a/.travis/travis_utils.sh b/.travis/travis_utils.sh index 9bfce97..85f45a6 100755 --- a/.travis/travis_utils.sh +++ b/.travis/travis_utils.sh @@ -23,10 +23,6 @@ prepare_package(){ if [ -z "$COMMIT" ]; then COMMIT=${TRAVIS_COMMIT::8} fi - V200_DOCKER_NAME=$DOCKER_ORG/$DOCKER_REPO:2.0.0-$VERSION-$BRANCH-$COMMIT - V200_DOCKER_NAME_LATEST=$DOCKER_ORG/$DOCKER_REPO:2.0.0 - V210_DOCKER_NAME=$DOCKER_ORG/$DOCKER_REPO:2.1.0-$VERSION-$BRANCH-$COMMIT - V210_DOCKER_NAME_LATEST=$DOCKER_ORG/$DOCKER_REPO:2.1.0 v212_DOCKER_NAME=$DOCKER_ORG/$DOCKER_REPO:2.1.2-$VERSION-$BRANCH-$COMMIT v212_DOCKER_NAME_LATEST=$DOCKER_ORG/$DOCKER_REPO:2.1.2 v172_DOCKER_NAME=$DOCKER_ORG/$DOCKER_REPO:1.7.2-$VERSION-$BRANCH-$COMMIT @@ -45,30 +41,6 @@ package_v172(){ fi } -package_v200(){ - build_message processing $V200_DOCKER_NAME - docker build 2.0.0/ -t $V200_DOCKER_NAME - build_message done processing $V200_DOCKER_NAME - if [ "$BRANCH" = "master" ] - then - build_message processing $V200_DOCKER_NAME_LATEST - docker tag $V200_DOCKER_NAME $V200_DOCKER_NAME_LATEST - build_message done processing $V200_DOCKER_NAME_LATEST - fi -} - -package_v210(){ - build_message processing $V210_DOCKER_NAME - docker build 2.1.0/ -t $V210_DOCKER_NAME - build_message done processing $V210_DOCKER_NAME - if [ "$BRANCH" = "master" ] - then - build_message processing $V210_DOCKER_NAME_LATEST - docker tag $V210_DOCKER_NAME $V210_DOCKER_NAME_LATEST - build_message done processing $V210_DOCKER_NAME_LATEST - fi -} - package_v212(){ build_message processing $v212_DOCKER_NAME docker build 2.1.2/ -t $v212_DOCKER_NAME @@ -93,30 +65,6 @@ push_v172(){ fi } -push_v200(){ - build_message pushing $V200_DOCKER_NAME - docker push $V200_DOCKER_NAME - build_message done pushing $V200_DOCKER_NAME - if [ "$BRANCH" = "master" ] - then - build_message pushing $V200_DOCKER_NAME_LATEST - docker push $V200_DOCKER_NAME_LATEST - build_message done pushing $V200_DOCKER_NAME_LATEST - fi -} - -push_v210(){ - build_message pushing $V210_DOCKER_NAME - docker push $V210_DOCKER_NAME - build_message done pushing $V210_DOCKER_NAME - if [ "$BRANCH" = "master" ] - then - build_message pushing $V210_DOCKER_NAME_LATEST - docker push $V210_DOCKER_NAME_LATEST - build_message done pushing $V210_DOCKER_NAME_LATEST - fi -} - push_v212(){ build_message pushing $v212_DOCKER_NAME docker push $v212_DOCKER_NAME @@ -135,20 +83,34 @@ deploy_v172(){ push_v172 } -deploy_v200(){ + +deploy_v212(){ login_docker - package_v200 - push_v200 + package_v212 + push_v212 } -deploy_v210(){ +deploy_v172_arm64(){ login_docker - package_v210 - push_v210 + sed -i -e "s/\(resin\/rpi-raspbian\)/resin\/aarch64-debian/" 1.7.2/Dockerfile + v172_DOCKER_NAME_LATEST="$DOCKER_ORG/$DOCKER_REPO:arm64-1.7.2" + v172_DOCKER_NAME="$DOCKER_ORG/$DOCKER_REPO:arm64-1.7.2-$VERSION-$BRANCH-$COMMIT" + package_v172 + push_v172 } -deploy_v212(){ +deploy_v212_arm64(){ login_docker + rm 2.1.2/Dockerfile + mv 2.1.2/Dockerfile-arm64 2.1.2/Dockerfile + if [ "$BRANCH" = "master" ] + then + sed -i -e "s|\(treehouses\/rpi-couchdb:2\.1\.2\)|$v212_DOCKER_NAME_LATEST|" 2.1.2/Dockerfile + else + sed -i -e "s|\(treehouses\/rpi-couchdb:2\.1\.2\)|$v212_DOCKER_NAME|" 2.1.2/Dockerfile + fi + v212_DOCKER_NAME_LATEST="$DOCKER_ORG/$DOCKER_REPO:arm64-2.1.2" + v212_DOCKER_NAME="$DOCKER_ORG/$DOCKER_REPO:arm64-2.1.2-$VERSION-$BRANCH-$COMMIT" package_v212 push_v212 } diff --git a/2.0.0/Dockerfile b/2.0.0/Dockerfile deleted file mode 100644 index 25fafe4..0000000 --- a/2.0.0/Dockerfile +++ /dev/null @@ -1,127 +0,0 @@ -# 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. - -FROM ubuntu as builder -LABEL maintainer="sahil@ole.org,mappuji@ole.org" - -COPY ./crosscompile.sh . -RUN bash ./crosscompile.sh armv7 install - -FROM resin/rpi-raspbian - -ENV COUCHDB_VERSION 2.0.0 - -#create dirs and links for the npm module -RUN mkdir -p /usr/lib/node_modules; \ - ln -s /usr/lib/node_modules/grunt-cli/bin/grunt /usr/bin/grunt - -COPY --from=builder /usr/lib/node_modules /usr/lib/node_modules - -# 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 \ - curl \ - erlang-nox \ - erlang-reltool \ - haproxy \ - libicu52 \ - libmozjs185-1.0 \ - openssl \ - && rm -rf /var/lib/apt/lists/* - -# grab gosu for easy step-down from root and tini for signal handling -RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \ - && curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \ - && gpg --verify /usr/local/bin/gosu.asc \ - && rm /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5; \ -# check if tini exists - if ! type "tini" > /dev/null; then \ - \ -# if not then install tini - curl -o /usr/local/bin/tini -fSL "https://github.com/krallin/tini/releases/download/v0.14.0/tini" \ - && curl -o /usr/local/bin/tini.asc -fSL "https://github.com/krallin/tini/releases/download/v0.14.0/tini.asc" \ - && gpg --verify /usr/local/bin/tini.asc \ - && rm /usr/local/bin/tini.asc \ - && chmod +x /usr/local/bin/tini; \ - fi; - -# https://www.apache.org/dist/couchdb/KEYS -ENV GPG_KEYS \ - 15DD4F3B8AACA54740EB78C7B7B7C53943ECCEE1 \ - 1CFBFA43C19B6DF4A0CA3934669C02FFDF3CEBA3 \ - 25BBBAC113C1BFD5AA594A4C9F96B92930380381 \ - 4BFCA2B99BADC6F9F105BEC9C5E32E2D6B065BFB \ - 5D680346FAA3E51B29DBCB681015F68F9DA248BC \ - 7BCCEB868313DDA925DF1805ECA5BCB7BB9656B0 \ - C3F4DFAEAD621E1C94523AEEC376457E61D50B88 \ - D2B17F9DA23C0A10991AF2E3D9EE01E47852AEE4 \ - E0AF0A194D55C84E4A19A801CDB0C0F904F4EE9B -RUN set -xe \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done - -ENV COUCHDB_VERSION 2.0.0 - -# Download dev dependencies -RUN buildDeps=' \ - apt-transport-https \ - gcc \ - git \ - g++ \ - erlang-dev \ - libcurl4-openssl-dev \ - libicu-dev \ - libmozjs185-dev \ - make \ - ' \ - && apt-get update -y -qq && apt-get install -y --no-install-recommends $buildDeps \ - && curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ - && echo 'deb https://deb.nodesource.com/node_4.x jessie main' > /etc/apt/sources.list.d/nodesource.list \ - && echo 'deb-src https://deb.nodesource.com/node_4.x jessie main' >> /etc/apt/sources.list.d/nodesource.list \ - && apt-get update -y -qq \ - && apt-get install -y nodejs \ - # Acquire CouchDB source code - && cd /usr/src && mkdir couchdb \ - && curl -fSL https://github.com/apache/couchdb/archive/$COUCHDB_VERSION.tar.gz -o couchdb.tar.gz \ - && tar -xzf couchdb.tar.gz -C couchdb --strip-components=1 \ - && cd couchdb \ - # Build the release and install into /opt - && ./configure --disable-docs \ - && make release \ - && mv /usr/src/couchdb/rel/couchdb /opt/ \ - # Cleanup build detritus - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* /usr/lib/node_modules /usr/src/couchdb* - -# Add configuration -COPY local.ini /opt/couchdb/etc/local.d/ -COPY vm.args /opt/couchdb/etc/ - -COPY ./docker-entrypoint.sh / - -# Setup directories and permissions -RUN chmod +x /docker-entrypoint.sh \ - && mkdir /opt/couchdb/data /opt/couchdb/etc/default.d \ - && chown -R couchdb:couchdb /opt/couchdb/ - -WORKDIR /opt/couchdb -EXPOSE 5984 4369 9100 -VOLUME ["/opt/couchdb/data"] - -ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] -CMD ["/opt/couchdb/bin/couchdb"] diff --git a/2.0.0/crosscompile.sh b/2.0.0/crosscompile.sh deleted file mode 100644 index 3c30e82..0000000 --- a/2.0.0/crosscompile.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -ARCH=$1 -ACT=$2 - -if [[ "${ARCH}" == "armv7" ]]; then - TRIPLE="arm-linux-gnueabihf" - GCC="4.8" -elif [[ "${ARCH}" == "armv8" ]]; then - TRIPLE="aarch64-linux-gnu" - GCC="4.8" -else - exit 1 -fi - -PACKAGES="gcc-${GCC}-${TRIPLE} g++-${GCC}-${TRIPLE}" -export CC="${TRIPLE}-gcc-${GCC}" -export CXX="${TRIPLE}-g++-${GCC}" -export STRIP="${TRIPLE}-strip" -export ZMQ_BUILD_OPTIONS="--host=${TRIPLE}" - -echo "Building grunt-cli for ${ARCH}" - -if [[ "${ACT}" == "install" ]]; then - apt-get update -qq - apt-get install -y curl - curl -sL https://deb.nodesource.com/setup_4.x | bash - - apt-get install -y nodejs build-essential ${PACKAGES} - npm install "--arch=${TRIPLE}" -g grunt-cli -else - echo "Error: No action Specified" -fi diff --git a/2.0.0/docker-entrypoint.sh b/2.0.0/docker-entrypoint.sh deleted file mode 100755 index 2ff1715..0000000 --- a/2.0.0/docker-entrypoint.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/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 - -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 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/2.0.0/local.ini b/2.0.0/local.ini deleted file mode 100644 index e5d7bc0..0000000 --- a/2.0.0/local.ini +++ /dev/null @@ -1,11 +0,0 @@ -; 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 -[log] -writer = file -file = /opt/couchdb/var/log/couch.log diff --git a/2.0.0/vm.args b/2.0.0/vm.args deleted file mode 100644 index 0425756..0000000 --- a/2.0.0/vm.args +++ /dev/null @@ -1,28 +0,0 @@ -# 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 diff --git a/2.1.0/docker-entrypoint.sh b/2.1.0/docker-entrypoint.sh deleted file mode 100755 index dda823d..0000000 --- a/2.1.0/docker-entrypoint.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/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/2.1.0/local.ini b/2.1.0/local.ini deleted file mode 100644 index e5d7bc0..0000000 --- a/2.1.0/local.ini +++ /dev/null @@ -1,11 +0,0 @@ -; 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 -[log] -writer = file -file = /opt/couchdb/var/log/couch.log diff --git a/2.1.0/vm.args b/2.1.0/vm.args deleted file mode 100644 index 6dcfb85..0000000 --- a/2.1.0/vm.args +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed under the Apache License, Version 2.1 (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 diff --git a/2.1.0/Dockerfile b/2.1.2/Dockerfile-arm64 similarity index 59% rename from 2.1.0/Dockerfile rename to 2.1.2/Dockerfile-arm64 index bf66cb1..3ee0bc7 100644 --- a/2.1.0/Dockerfile +++ b/2.1.2/Dockerfile-arm64 @@ -10,21 +10,26 @@ # License for the specific language governing permissions and limitations under # the License. -FROM resin/rpi-raspbian -LABEL maintainer="sahil@ole.org,mappuji@ole.org" +#We will be building 64-bit after 32-bit. So we can use this as builder. +FROM treehouses/rpi-couchdb:2.1.2 as builder +FROM resin/aarch64-debian +LABEL maintainer="sahil@ole.org,mappuji@ole.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 \ +RUN dpkg --add-architecture armhf \ + && apt-get update -y && apt-get install -y --no-install-recommends \ ca-certificates \ - curl \ - erlang-nox \ - erlang-reltool \ - haproxy \ - libicu52 \ - libmozjs185-1.0 \ + ca-certificates:armhf \ + curl:armhf \ + #erlang-nox: dummy packages dont support different architecture install. Hence install all separately. + erlang-base:armhf erlang-asn1:armhf erlang-corba:armhf erlang-crypto:armhf erlang-diameter:armhf erlang-edoc:armhf erlang-eldap:armhf erlang-erl-docgen:armhf erlang-eunit:armhf erlang-ic:armhf erlang-inets:armhf erlang-mnesia:armhf erlang-odbc:armhf erlang-os-mon:armhf erlang-parsetools:armhf erlang-percept:armhf erlang-public-key:armhf erlang-runtime-tools:armhf erlang-snmp:armhf erlang-ssh:armhf erlang-ssl:armhf erlang-syntax-tools:armhf erlang-tools:armhf erlang-webtool:armhf erlang-xmerl:armhf \ + erlang-reltool:armhf \ + haproxy:armhf \ + libicu52:armhf \ + libmozjs185-1.0:armhf \ openssl \ && rm -rf /var/lib/apt/lists/* @@ -65,53 +70,12 @@ RUN set -ex; \ fi; \ apt-get purge -y --auto-remove wget -# https://www.apache.org/dist/couchdb/KEYS -ENV GPG_KEYS \ - 15DD4F3B8AACA54740EB78C7B7B7C53943ECCEE1 \ - 1CFBFA43C19B6DF4A0CA3934669C02FFDF3CEBA3 \ - 25BBBAC113C1BFD5AA594A4C9F96B92930380381 \ - 4BFCA2B99BADC6F9F105BEC9C5E32E2D6B065BFB \ - 5D680346FAA3E51B29DBCB681015F68F9DA248BC \ - 7BCCEB868313DDA925DF1805ECA5BCB7BB9656B0 \ - C3F4DFAEAD621E1C94523AEEC376457E61D50B88 \ - D2B17F9DA23C0A10991AF2E3D9EE01E47852AEE4 \ - E0AF0A194D55C84E4A19A801CDB0C0F904F4EE9B \ - 29E4F38113DF707D722A6EF91FE9AF73118F1A7C \ - 2EC788AE3F239FA13E82D215CDE711289384AE37 -RUN set -xe \ - && for key in $GPG_KEYS; do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - done -ENV COUCHDB_VERSION 2.1.0 +RUN mkdir -p /opt/couchdb +#Copy pre-compiled couchdb From builder +#This is to be done as CouchDB doesn't compile on arm64 +COPY --from=builder /opt/couchdb /opt/couchdb -# Download dev dependencies -RUN buildDeps=' \ - apt-transport-https \ - gcc \ - g++ \ - git \ - erlang-dev \ - libcurl4-openssl-dev \ - libicu-dev \ - libmozjs185-dev \ - make \ - ' \ - && apt-get update -y -qq && apt-get install -y --no-install-recommends $buildDeps \ - # Acquire CouchDB source code - && cd /usr/src && mkdir couchdb \ - && curl -fSL https://github.com/apache/couchdb/archive/$COUCHDB_VERSION.tar.gz -o couchdb.tar.gz \ - && tar -xzf couchdb.tar.gz -C couchdb --strip-components=1 \ - && cd couchdb \ - # Build the release and install into /opt - && ./configure --disable-docs \ - && make release \ - && mv /usr/src/couchdb/rel/couchdb /opt/ \ - # Cleanup build detritus - && apt-get purge -y --auto-remove $buildDeps \ - && rm -rf /var/lib/apt/lists/* /usr/src/couchdb* \ - && mkdir /opt/couchdb/data \ - && chown -R couchdb:couchdb /opt/couchdb # Add configuration COPY local.ini /opt/couchdb/etc/local.d/ @@ -120,7 +84,7 @@ COPY vm.args /opt/couchdb/etc/ COPY ./docker-entrypoint.sh / # Setup directories and permissions -RUN chown -R couchdb:couchdb /opt/couchdb/etc/local.d/ /opt/couchdb/etc/vm.args +RUN chown -R couchdb:couchdb /opt/couchdb WORKDIR /opt/couchdb EXPOSE 5984 4369 9100 diff --git a/README.md b/README.md index 73f5ee4..15963df 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,16 @@ Credits to [klaemo](https://github.com/klaemo) and [apache](https://github.com/a ## Where it hosted -This work is hosted in [treehouses/couchdb](https://hub.docker.com/r/treehouses/couchdb/) +This work is hosted in [treehouses/couchdb](https://hub.docker.com/r/treehouses/couchdb/). It is a multi architecture image. + +## Supported architectures + `amd64`, `arm`, `arm64` + + (Note: The image for `amd64` is the official couchdb docker image, which can also be found at [amd64/couchdb](https://hub.docker.com/r/amd64/couchdb/)) ## Naming and Versioning -Currently we maintain multi-architecture repository of 2.x.x version as well as 1.7.1 of CouchDB. Supported architectures: `amd64, arm` +Currently we maintain multi-architecture repository of 2.x.x version as well as 1.7.1 of CouchDB. For RPi CouchDB 1.7.1 ```