-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathDockerfile
103 lines (87 loc) · 3.53 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
FROM ubuntu:20.04
LABEL maintainer="docker@couchbase.com"
ARG UPDATE_COMMAND="apt-get update -y -q"
ARG CLEANUP_COMMAND="rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"
# Install dependencies:
# runit: for container process management
# wget: for downloading .deb
# tzdata: timezone info used by some N1QL functions
# Additional dependencies for system commands used by cbcollect_info:
# lsof: lsof
# lshw: lshw
# sysstat: iostat, sar, mpstat
# net-tools: ifconfig, arp, netstat
# numactl: numactl
RUN set -x \
&& ${UPDATE_COMMAND} \
&& apt-get install -y -q wget tzdata \
lsof lshw sysstat net-tools numactl bzip2 runit \
&& ${CLEANUP_COMMAND}
ARG CB_VERSION=6.6.5
ARG CB_RELEASE_URL=https://packages.couchbase.com/releases/6.6.5
ARG CB_PACKAGE=couchbase-server-enterprise_6.6.5-ubuntu20.04_amd64.deb
ARG CB_SHA256=fb2da1880ea993dc7a5695c6fbe14cde62024d865a71a7d44ab653f0f633d4c6
ENV PATH=$PATH:/opt/couchbase/bin:/opt/couchbase/bin/tools:/opt/couchbase/bin/install
# Create Couchbase user with UID 1000 (necessary to match default
# boot2docker UID)
RUN groupadd -g 1000 couchbase && useradd couchbase -u 1000 -g couchbase -M
# Install couchbase
RUN set -x \
&& export INSTALL_DONT_START_SERVER=1 \
&& wget -N --no-verbose $CB_RELEASE_URL/$CB_PACKAGE \
&& echo "$CB_SHA256 $CB_PACKAGE" | sha256sum -c - \
&& ${UPDATE_COMMAND} \
&& apt-get install -y ./$CB_PACKAGE \
&& rm -f ./$CB_PACKAGE \
&& ${CLEANUP_COMMAND} \
&& rm -rf /tmp/* /var/tmp/*
# Update VARIANT.txt to indicate we're running in our Docker image
RUN sed -i -e '1 s/$/\/docker/' /opt/couchbase/VARIANT.txt
# Add runit script for couchbase-server
COPY scripts/run /etc/service/couchbase-server/run
RUN set -x \
&& mkdir -p /etc/runit/runsvdir/default/couchbase-server/supervise \
&& chown -R couchbase:couchbase \
/etc/service \
/etc/runit/runsvdir/default/couchbase-server/supervise
# Add dummy script for commands invoked by cbcollect_info that
# make no sense in a Docker container
COPY scripts/dummy.sh /usr/local/bin/
RUN set -x \
&& ln -s dummy.sh /usr/local/bin/iptables-save \
&& ln -s dummy.sh /usr/local/bin/lvdisplay \
&& ln -s dummy.sh /usr/local/bin/vgdisplay \
&& ln -s dummy.sh /usr/local/bin/pvdisplay
# Fix curl RPATH if necessary - if curl.real exists, it's a new
# enough package that we don't need to do anything. If not, it
# may be OK, but just fix it
RUN set -ex \
&& if [ ! -e /opt/couchbase/bin/curl.real ]; then \
${UPDATE_COMMAND}; \
apt-get install -y chrpath; \
chrpath -r '$ORIGIN/../lib' /opt/couchbase/bin/curl; \
apt-get remove -y chrpath; \
apt-get autoremove -y; \
${CLEANUP_COMMAND}; \
fi
# Add bootstrap script
COPY scripts/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["couchbase-server"]
# 8091: Couchbase Web console, REST/HTTP interface
# 8092: Views, queries, XDCR
# 8093: Query services (4.0+)
# 8094: Full-text Search (4.5+)
# 8095: Analytics (5.5+)
# 8096: Eventing (5.5+)
# 11207: Smart client library data node access (SSL)
# 11210: Smart client library/moxi data node access
# 11211: Legacy non-smart client library data node access
# 18091: Couchbase Web console, REST/HTTP interface (SSL)
# 18092: Views, query, XDCR (SSL)
# 18093: Query services (SSL) (4.0+)
# 18094: Full-text Search (SSL) (4.5+)
# 18095: Analytics (SSL) (5.5+)
# 18096: Eventing (SSL) (5.5+)
EXPOSE 8091 8092 8093 8094 8095 8096 11207 11210 11211 18091 18092 18093 18094 18095 18096
VOLUME /opt/couchbase/var