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

Add ArangoDB Official images #728

Merged
merged 8 commits into from
Jul 14, 2015
Merged

Add ArangoDB Official images #728

merged 8 commits into from
Jul 14, 2015

Conversation

dothebart
Copy link
Contributor

ArangoDB is a the multi-model NoSQL database - http://arangodb.org

@tianon
Copy link
Member

tianon commented Jun 10, 2015

Just to make sure the comments aren't missed in IRC backlog (https://botbot.me/freenode/docker-library/msg/41493887/):

10:55:42 <tianon> dothebart: what's the problem that "--force-yes" is solving in your ArangoDB Dockerfile?  usually when I see that it throws up red flags because that almost always points at a mismanaging of apt-keys :s
10:57:12 <tianon> dothebart: also, https://github.com/docker-library/official-images/blob/master/README.md#consistency is probably worth a read -- I'm not even sure what all this start.sh script is doing, especially why it's spawning /bin/bash after arangod
10:58:34 <tianon> dothebart: also, logging -- does arangod not have a built-in method for logging directly to stdout?  if not, does "file = /dev/stdout" in the conf file work to accomplish this without that extra "tail -f" process running?

@tianon
Copy link
Member

tianon commented Jun 10, 2015

Is there a default configuration path/file that could be overwritten instead so we could avoid the manual configuration file specification in start.sh?

@tianon
Copy link
Member

tianon commented Jun 10, 2015

Any particular benefit to downloading and extracting the .deb file directly instead of just adding the repository to sources.list?

@tianon
Copy link
Member

tianon commented Jun 10, 2015

Here's something a little more concrete to make it more clear what I mean:

diff --git a/Dockerfile.templ b/Dockerfile.templ
index db4dd70..1eb4806 100644
--- a/Dockerfile.templ
+++ b/Dockerfile.templ
@@ -2,42 +2,29 @@ FROM debian:jessie
 MAINTAINER Frank Celler <info@arangodb.com>


-RUN apt-get -y --force-yes update && \
-    apt-get -y --force-yes install \
-        apt-transport-https \
-        gnupg \
-        libreadline6 \
-        libssl1.0.0 \
-        libstdc++6 \
-        wget \
-    && \
+RUN apt-get update && \
+    apt-get install -y apt-transport-https && \
+    rm -rf /var/lib/apt/lists/*
+
+RUN echo 'deb https://www.arangodb.com/repositories/arangodb2/Debian_8.0 /' > /etc/apt/sources.list.d/arangodb.list && \
     apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys C60515C5EC94954D9B5A0302358D849C89A14917 && \
-    apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys CD8CB0F1E0AD5B52E93F41E7EA93F5E56E751E9B && \
-    gpg --keyserver ha.pool.sks-keyservers.net --recv-keys CD8CB0F1E0AD5B52E93F41E7EA93F5E56E751E9B
+    apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys CD8CB0F1E0AD5B52E93F41E7EA93F5E56E751E9B

-ENV ARCHITECTURE amd64
 ENV ARANGO_VERSION @VERSION@
-ENV ARANGO_URL https://www.arangodb.com/repositories/arangodb2/Debian_8.0
-ENV ARANGO_PACKAGE arangodb_${ARANGO_VERSION}_${ARCHITECTURE}.deb
-ENV ARANGO_PACKAGE_URL ${ARANGO_URL}/${ARCHITECTURE}/${ARANGO_PACKAGE}
-ENV ARANGO_SIGNATURE_URL ${ARANGO_PACKAGE_URL}.asc
-
-RUN echo "deb $ARANGO_URL /" > /etc/apt/sources.list.d/arangodb.list

-RUN wget ${ARANGO_SIGNATURE_URL} &&       \
-    wget ${ARANGO_PACKAGE_URL} &&         \
-    gpg --verify ${ARANGO_PACKAGE}.asc && \
-    dpkg -i ${ARANGO_PACKAGE}
+RUN apt-get update && \
+    apt-get install -y arangodb=$ARANGO_VERSION && \
+    rm -rf /var/lib/apt/lists/* && \
+    sed -ri \
+# https://docs.arangodb.com/ConfigureArango/Arangod.html
+        -e 's!127\.0\.0\.1!0.0.0.0!g' \
+# https://docs.arangodb.com/ConfigureArango/Logging.html
+        -e 's!^(file\s*=).*!\1 -!' \
+        /etc/arangodb/arangod.conf

-# expose the database directory (data), Foxx Application directory (apps, apps-dev) and logs
-VOLUME ["/data", "/apps", "/apps-dev", "/logs"]
+# retain the database directory
+VOLUME ["/var/lib/arangodb"]

 # standard port
 EXPOSE 8529
-
-# add HELP file
-COPY ./HELP.md /HELP.md
-# start script
-COPY ./arangod-docker.conf /etc/arangodb/
-COPY ./start.sh /etc/arangodb/
-ENTRYPOINT ["/etc/arangodb/start.sh"]
+CMD ["arangod"]

@dothebart
Copy link
Contributor Author

The problem why I did not go the apt-aproach way is, that we only have the latest stable version of each release line available via apt (i.e. after 2.5.5 was released, 2.5.4 vanished); This is the right thing to do for all other usecases; Regular apt-repositories simply behave like that. Its not easily changeable as the Packages files and the signing are done on Suse OBS. For that reason I went the route of wget & pgp & signing each package separately.

I will copy the arangod-docker.conf to arangod.conf instead, which will remove the need to specify it.
I will simplify start.sh, and change the logging to stdout. Are the logs kept by docker then? As users may want to inspect them later on for messages earlier sent...

@yosifkit
Copy link
Member

Yes, docker logs will allow the user to get the logs of a container. I made a PR with a few suggestions: arangodb/arangodb-docker#7.

@yosifkit
Copy link
Member

yosifkit commented Jul 1, 2015

Sorry for the slow reply, github does not notify us of new commits, so feel free to ping us next time. It all looks great.

Are 2.5.3 and 2.5.4 just to backfill the docker images available or will they be "supported versions" along with the others? Once built, we don't remove old tags from the Docker Hub unless explicitly told to, so old versions will be available in perpetuity. So if it just for backfill, we would appreciate a PR after this is merged to remove them from the library file 😄. The items in the library file also control the "supported tags" section of the description on the Docker Hub, so it will be beneficial to your team on which versions you will actually accept issues and PRs on.

@yosifkit
Copy link
Member

yosifkit commented Jul 1, 2015

2.6.0 is failing to build. It looks like a 404 on the asc file: https://www.arangodb.com/repositories/arangodb2/Debian_8.0/amd64/arangodb_2.6.0_amd64.deb.asc

@dothebart
Copy link
Contributor Author

I've fixed our build process and they're generated from now on.

The old versions will remain available, but from one release series the latest is advised to be used.
Yes, we can then remove them. Whats the suggested way to handle the transition for the users? so they can upgrade their containers?

@yosifkit
Copy link
Member

yosifkit commented Jul 7, 2015

The easiest way to upgrade most containers is to pull the new version and start it while bind mounting the old data storage directory (some databases may have a more complicated transition, like postgres).

I am getting a new error in building 2.6:

Preparing to unpack arangodb_2.6.0_amd64.deb ...
Unpacking arangodb (2.6.0) ...
dpkg: dependency problems prevent configuration of arangodb:
 arangodb depends on libgoogle-perftools4; however:
  Package libgoogle-perftools4 is not installed.

dpkg: error processing package arangodb (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (215-17+deb8u1) ...
Errors were encountered while processing:
 arangodb

Probably just need an apt-get install -f after the dpkg and move the rm -rf /var/lib/apt/lists/* after this new apt install.

@dothebart
Copy link
Contributor Author

I've updaed the pull request accordingly.

@psftw
Copy link
Contributor

psftw commented Jul 9, 2015

Dockerfiles look good to me and the app behaves well (I tried 2.6.2 only). I just ran in to the libgoogle-perftools4 dependency issue though since the PR here (for the library/arangodb file) hasn't been updated to reflect the latest commit/versions.

@yosifkit
Copy link
Member

LGTM, Build test of #728; df2a881 (arangodb):

$ url="https://raw.githubusercontent.com/docker-library/official-images/df2a88199611f27f93e16632da2575e5a89332a7/library/arangodb"
$ bashbrew build "$url"
Fetching arangodb (git://github.com/arangodb/arangodb-docker) ...
Processing arangodb:2.5.3 ...
Processing arangodb:2.5.4 ...
Processing arangodb:2.5.5 ...
Processing arangodb:2.6.0 ...
Processing arangodb:2.6.1 ...
Processing arangodb:2.6.2 ...
$ bashbrew list --uniq "$url" | xargs test/run.sh
testing arangodb:2.5.3
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed
testing arangodb:2.5.4
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed
testing arangodb:2.5.5
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed
testing arangodb:2.6.0
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed
testing arangodb:2.6.1
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed
testing arangodb:2.6.2
    'utc' [1/3]...passed
    'cve-2014--shellshock' [2/3]...passed
    'no-hard-coded-passwords' [3/3]...passed

And once they are built they'll be a PR to drop the unsupported versions shortly? 😉

@tianon
Copy link
Member

tianon commented Jul 14, 2015

LGTM

tianon added a commit that referenced this pull request Jul 14, 2015
Add ArangoDB Official images
@tianon tianon merged commit 6a2a678 into docker-library:master Jul 14, 2015
@tianon
Copy link
Member

tianon commented Jul 14, 2015

Will look forward to the PR dropping all the older versions soon. 👍

@tianon
Copy link
Member

tianon commented Jul 14, 2015

Oh, and I suppose a PR to https://github.com/docker-library/docs too. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants