forked from brianshumate/docker-couchbase-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
62 lines (53 loc) · 2.78 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Simple Couchbase Server instance
#
# Install Couchbase Server Community Edition (version as per CB_VERSION below)
#
# VERSION 0.9.4
FROM ubuntu
MAINTAINER Brian Shumate, [email protected]
ENV CB_VERSION 2.2.0
ENV CB_BASE_URL http://packages.couchbase.com/releases
ENV CB_PACKAGE couchbase-server-community_${CB_VERSION}_x86_64.deb
ENV CB_DOWNLOAD_URL ${CB_BASE_URL}/${CB_VERSION}/${CB_PACKAGE}
ENV CB_LOCAL_PATH /tmp/${CB_PACKAGE}
# Limits
RUN sed -i.bak '/\# End of file/ i\\# Following 4 lines added by docker-couchbase-server' /etc/security/limits.conf
RUN sed -i.bak '/\# End of file/ i\\* hard memlock unlimited' /etc/security/limits.conf
RUN sed -i.bak '/\# End of file/ i\\* soft memlock unlimited\n' /etc/security/limits.conf
RUN sed -i.bak '/\# End of file/ i\\* hard nofile 65536' /etc/security/limits.conf
RUN sed -i.bak '/\# End of file/ i\\* soft nofile 65536\n' /etc/security/limits.conf
RUN sed -i.bak '/\# end of pam-auth-update config/ i\\# Following line was added by docker-couchbase-server' /etc/pam.d/common-session
RUN sed -i.bak '/\# end of pam-auth-update config/ i\session required pam_limits.so\n' /etc/pam.d/common-session
# Locale and supporting utility commands
RUN locale-gen en_US en_US.UTF-8
RUN echo 'root:couchbase' | chpasswd
RUN mkdir -p /var/run/sshd
# Add Universe (for libssl0.9.8 dependency), update & install packages
RUN sed -i.bak 's/main$/main universe/' /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get -y install librtmp0 libssl0.9.8 lsb-release openssh-server
# Download Couchbase Server package to /tmp & install
ADD $CB_DOWNLOAD_URL $CB_LOCAL_PATH
RUN dpkg -i $CB_LOCAL_PATH
# Open the OpenSSH server and Couchbase Server ports
EXPOSE 22 4369 8091 8092 11209 11210 11211
# couchbase-script approach (thanks for the ideas Dustin!)
VOLUME /home/couchbase-server:/opt/couchbase/var
RUN rm -r /opt/couchbase/var/lib
ADD bin/couchbase-script /usr/local/sbin/couchbase
RUN chmod 755 /usr/local/sbin/couchbase
CMD /usr/local/sbin/couchbase
##############################################################################
# The following bits are for using Couchbase Server with supervisord instead
# NB: This is a WIP and might actually be broken out into a separate file
# or discarded altogether
##############################################################################
# RUN mkdir -p /var/log/supervisor
# ADD supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# RUN apt-get -y install supervisor
# Stop supervisord
# RUN /etc/init.d/supervisor stop
# Start the supervisord process, thereby also starting Couchbase Server & sshd
# Still working on this; works fine from a shell, but doesn't want to stay
# up on boot
# CMD ["/usr/bin/supervisord"]