Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ARM64 (Fixes #22) #25

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
09b7b5c
Update base image for 2.1.1
sahilph May 22, 2018
a330f47
Change base for 2.1.0
sahilph May 22, 2018
ce14cc6
Change base for 2.0.0
sahilph May 22, 2018
0eaa494
Change base for 1.7.1
sahilph May 22, 2018
4892d40
Updated libicu version to 55
sahilph May 22, 2018
238e8fd
Revert "Updated libicu version to 55"
sahilph May 22, 2018
cca54eb
Change all bases to raspbian
sahilph May 22, 2018
328ce3d
Add travis update param
sahilph May 22, 2018
5762828
No need to check tini
sahilph May 22, 2018
71f2f5e
Revert "No need to check tini"
sahilph May 22, 2018
a8a070d
Check if tini exists
sahilph May 24, 2018
3cd21c4
fix syntax
sahilph May 24, 2018
e084018
Add support for arm64 (Fixes #22)
sahilph May 29, 2018
f7573c5
Fix Syntax for arm64
sahilph May 29, 2018
0b7c209
fix arm64 vars
sahilph May 29, 2018
af644c6
Even more var fixes
sahilph May 29, 2018
4ac3874
Merge branch 'master' into add-arm64-support
sahilph Jun 11, 2018
7a81fe4
32 on 64
sahilph Jun 11, 2018
4125c14
Change mozjs get method
sahilph Jun 11, 2018
656662e
No need of the gdebi and mozjs copy
sahilph Jun 11, 2018
538f9fb
Fix syntax
sahilph Jun 11, 2018
d3e792c
Modify travis util
sahilph Jun 11, 2018
3f295a1
Change branch condition to current branch for testing
sahilph Jun 11, 2018
5067b76
Revert "Change branch condition to current branch for testing"
sahilph Jun 11, 2018
8390b4c
Manifest tag fix
sahilph Jun 11, 2018
5a2b63c
sed fix
sahilph Jun 12, 2018
0dd1671
Update readme
sahilph Jun 12, 2018
a0db802
Merge branch 'master' into add-arm64-support
sahilph Jul 24, 2018
0dfca2e
Fix Conflicts, Delete Obselete versions
sahilph Jul 24, 2018
883ab46
Fix vars
sahilph Jul 24, 2018
e3fff74
Fix even more vars
sahilph Jul 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis/deploy_docker_rpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ build_message Build V211 image started...
deploy_v211
build_message Build V211 image finished, check build result!

build_message Build V171 arm64 image started...
deploy_v171_arm64
build_message Build V171 arm64 image finished, check build result!

build_message Build V211 arm64 image started...
deploy_v211_arm64
build_message Build V211 arm64 image finished, check build result!

build_message Preparing to Push multi-arch manifest to Docker Cloud ..
deploy_multiarch

6 changes: 5 additions & 1 deletion .travis/multiarch_manifests/multiarch_manifest_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ manifests:
platform:
architecture: arm
os: linux
-
image: treehouses/rpi-couchdb:arm64-2.1.1
platform:
architecture: arm64
os: linux
-
image: amd64/couchdb:2.1.1
platform:
architecture: amd64
os: linux

5 changes: 5 additions & 0 deletions .travis/multiarch_manifests/multiarch_manifest_v1.7.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ manifests:
platform:
architecture: arm
os: linux
-
image: treehouses/rpi-couchdb:arm64-1.7.1
platform:
architecture: arm64
os: linux
-
image: amd64/couchdb:1.7.1
platform:
Expand Down
5 changes: 5 additions & 0 deletions .travis/multiarch_manifests/multiarch_manifest_v2.1.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ manifests:
platform:
architecture: arm
os: linux
-
image: treehouses/rpi-couchdb:arm64-2.1.1
platform:
architecture: arm64
os: linux
-
image: amd64/couchdb:2.1.1
platform:
Expand Down
25 changes: 25 additions & 0 deletions .travis/travis_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,31 @@ deploy_v211(){
push_v211
}

deploy_v171_arm64(){
login_docker
sed -i -e "s/\(resin\/rpi-raspbian\)/resin\/aarch64-debian/" 1.7.1/Dockerfile
V171_DOCKER_NAME_LATEST="$DOCKER_ORG/$DOCKER_REPO:arm64-1.7.1"
V171_DOCKER_NAME="$DOCKER_ORG/$DOCKER_REPO:arm64-1.7.1-$VERSION-$BRANCH-$COMMIT"
package_v171
push_v171
}

deploy_v211_arm64(){
login_docker
rm 2.1.1/Dockerfile
mv 2.1.1/Dockerfile-arm64 2.1.1/Dockerfile
if [ "$BRANCH" = "master" ]
then
sed -i -e "s|\(treehouses\/rpi-couchdb:2\.1\.1\)|$V211_DOCKER_NAME_LATEST|" 2.1.1/Dockerfile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sed is faster, but for OLE you create YAML on the fly, any specific reason not doing that what in this repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason as such. This is how we used to do it before I found the method to create it on the fly. 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🆗

else
sed -i -e "s|\(treehouses\/rpi-couchdb:2\.1\.1\)|$V211_DOCKER_NAME|" 2.1.1/Dockerfile
fi
V211_DOCKER_NAME_LATEST="$DOCKER_ORG/$DOCKER_REPO:arm64-2.1.1"
V211_DOCKER_NAME="$DOCKER_ORG/$DOCKER_REPO:arm64-2.1.1-$VERSION-$BRANCH-$COMMIT"
package_v211
push_v211
}

deploy_multiarch(){
if [ "$BRANCH" = "master" ]
then
Expand Down
94 changes: 94 additions & 0 deletions 2.1.1/Dockerfile-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# 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.

#We will be building 64-bit after 32-bit. So we can use this as builder.
FROM treehouses/rpi-couchdb:2.1.1 as builder

FROM resin/aarch64-debian
LABEL maintainer="[email protected],[email protected]"

# Add CouchDB user account
RUN groupadd -r couchdb && useradd -d /opt/couchdb -g couchdb couchdb

RUN dpkg --add-architecture armhf \
&& apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates \
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/*

# 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; \
\
# check if tini exists
if ! type "tini" > /dev/null; then \
\
# if not then 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; \
\
fi; \
apt-get purge -y --auto-remove wget


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


# 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 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"]
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down