mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Added updated working Riak Dockerfile and documentation.
Signed-off-by: Elijah Zupancic <elijah@zupancic.name>
This commit is contained in:
parent
31c5041157
commit
de45aacc32
3 changed files with 73 additions and 34 deletions
31
docs/sources/examples/running_riak_service.Dockerfile
Normal file
31
docs/sources/examples/running_riak_service.Dockerfile
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Riak
|
||||
#
|
||||
# VERSION 0.1.1
|
||||
|
||||
# Use the Ubuntu base image provided by dotCloud
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER Hector Castro hector@basho.com
|
||||
|
||||
# Install Riak repository before we do apt-get update, so that update happens
|
||||
# in a single step
|
||||
RUN apt-get install -q -y curl && \
|
||||
curl -sSL https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo bash
|
||||
|
||||
# Install and setup project dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y supervisor riak=2.0.5-1
|
||||
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
|
||||
RUN locale-gen en_US en_US.UTF-8
|
||||
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Configure Riak to accept connections from any host
|
||||
RUN sed -i "s|listener.http.internal = 127.0.0.1:8098|listener.http.internal = 0.0.0.0:8098|" /etc/riak/riak.conf
|
||||
RUN sed -i "s|listener.protobuf.internal = 127.0.0.1:8087|listener.protobuf.internal = 0.0.0.0:8087|" /etc/riak/riak.conf
|
||||
|
||||
# Expose Riak Protocol Buffers and HTTP interfaces
|
||||
EXPOSE 8087 8098
|
||||
|
||||
CMD ["/usr/bin/supervisord"]
|
|
@ -15,28 +15,34 @@ Create an empty file called `Dockerfile`:
|
|||
|
||||
Next, define the parent image you want to use to build your image on top
|
||||
of. We'll use [Ubuntu](https://registry.hub.docker.com/_/ubuntu/) (tag:
|
||||
`latest`), which is available on [Docker Hub](https://hub.docker.com):
|
||||
`trusty`), which is available on [Docker Hub](https://hub.docker.com):
|
||||
|
||||
# Riak
|
||||
#
|
||||
# VERSION 0.1.0
|
||||
# VERSION 0.1.1
|
||||
|
||||
# Use the Ubuntu base image provided by dotCloud
|
||||
FROM ubuntu:latest
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER Hector Castro hector@basho.com
|
||||
|
||||
After that, we install and setup a few dependencies:
|
||||
After that, we install the curl which is used to download the repository setup
|
||||
script and we download the setup script and run it.
|
||||
|
||||
# Install Riak repository before we do apt-get update, so that update happens
|
||||
# in a single step
|
||||
RUN apt-get install -q -y curl && \
|
||||
curl -sSL https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo bash
|
||||
|
||||
Then we install and setup a few dependencies:
|
||||
|
||||
- `curl` is used to download Basho's APT
|
||||
repository key
|
||||
- `lsb-release` helps us derive the Ubuntu release
|
||||
codename
|
||||
- `supervisor` is used manage the Riak processes
|
||||
- `riak=2.0.5-1` is the Riak package coded to version 2.0.5
|
||||
|
||||
<!-- -->
|
||||
|
||||
# Install and setup project dependencies
|
||||
RUN apt-get update && apt-get install -y curl lsb-release supervisor
|
||||
RUN apt-get update && \
|
||||
apt-get install -y supervisor riak=2.0.5-1
|
||||
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
|
||||
|
@ -44,18 +50,11 @@ After that, we install and setup a few dependencies:
|
|||
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN echo 'root:basho' | chpasswd
|
||||
After that, we modify Riak's configuration:
|
||||
|
||||
Next, we add Basho's APT repository:
|
||||
|
||||
RUN curl -sSL http://apt.basho.com/gpg/basho.apt.key | apt-key add --
|
||||
RUN echo "deb http://apt.basho.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/basho.list
|
||||
|
||||
After that, we install Riak and alter a few defaults:
|
||||
|
||||
# Install Riak and prepare it to run
|
||||
RUN apt-get update && apt-get install -y riak
|
||||
RUN sed -i.bak 's/127.0.0.1/0.0.0.0/' /etc/riak/app.config
|
||||
# Configure Riak to accept connections from any host
|
||||
RUN sed -i "s|listener.http.internal = 127.0.0.1:8098|listener.http.internal = 0.0.0.0:8098|" /etc/riak/riak.conf
|
||||
RUN sed -i "s|listener.protobuf.internal = 127.0.0.1:8087|listener.protobuf.internal = 0.0.0.0:8087|" /etc/riak/riak.conf
|
||||
|
||||
Then, we expose the Riak Protocol Buffers and HTTP interfaces, along
|
||||
with SSH:
|
||||
|
@ -63,8 +62,7 @@ with SSH:
|
|||
# Expose Riak Protocol Buffers and HTTP interfaces
|
||||
EXPOSE 8087 8098
|
||||
|
||||
Finally, run `supervisord` so that Riak and OpenSSH
|
||||
are started:
|
||||
Finally, run `supervisord` so that Riak is started:
|
||||
|
||||
CMD ["/usr/bin/supervisord"]
|
||||
|
||||
|
@ -80,15 +78,13 @@ Populate it with the following program definitions:
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:sshd]
|
||||
command=/usr/sbin/sshd -D
|
||||
stdout_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
stderr_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
autorestart=true
|
||||
|
||||
[program:riak]
|
||||
command=bash -c ". /etc/default/riak && /usr/sbin/riak console"
|
||||
pidfile=/var/log/riak/riak.pid
|
||||
command=bash -c "/usr/sbin/riak console"
|
||||
numprocs=1
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=riak
|
||||
environment=HOME="/var/lib/riak"
|
||||
stdout_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
stderr_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
|
||||
|
|
12
docs/sources/examples/supervisord.conf
Normal file
12
docs/sources/examples/supervisord.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:riak]
|
||||
command=bash -c "/usr/sbin/riak console"
|
||||
numprocs=1
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=riak
|
||||
environment=HOME="/var/lib/riak"
|
||||
stdout_logfile=/var/log/supervisor/%(program_name)s.log
|
||||
stderr_logfile=/var/log/supervisor/%(program_name)s.log
|
Loading…
Reference in a new issue