forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
71 lines (61 loc) · 2 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
FROM golang:1.4-wheezy
# Install Vitess build dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
automake \
bison \
bzip2 \
curl \
g++ \
git \
libssl-dev \
libtool \
make \
memcached \
mercurial \
openjdk-7-jre-headless \
pkg-config \
python-dev \
python-mysqldb \
python-software-properties \
python-pip \
python-virtualenv \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install MariaDB 10.0.x
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db && \
add-apt-repository 'deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/debian wheezy main' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server libmariadbclient-dev
# Add VOLUME
VOLUME /vt/vtdataroot
# Load files from directory containing Dockerfile
COPY . /vt/src/github.com/youtube/vitess
# Create vitess user
RUN groupadd -r vitess && useradd -r -g vitess vitess && \
chown -R vitess:vitess /vt
# Compile and install required packages as root
WORKDIR /vt/src/github.com/youtube/vitess
RUN ./travis/install_grpc.sh
# Bootstrap Vitess
ENV MYSQL_FLAVOR MariaDB
USER vitess
RUN ./bootstrap.sh --skip_root_installs
# Set up environment (equivalent to '. dev.env')
ENV VTTOP /vt/src/github.com/youtube/vitess
ENV VTROOT /vt
ENV GOTOP $VTTOP/go
ENV PYTOP $VTTOP/py
ENV VTDATAROOT $VTROOT/vtdataroot
ENV VTPORTSTART 15000
ENV PYTHONPATH $VTROOT/dist/py-cbson/lib/python2.7/site-packages:$VTROOT/dist/py-vt-bson-0.3.2/lib/python2.7/site-packages:$VTROOT/py-vtdb
ENV GOBIN $VTROOT/bin
ENV GOPATH $VTROOT
ENV PATH $VTROOT/bin:$PATH
ENV VT_MYSQL_ROOT /usr
ENV PKG_CONFIG_PATH $VTROOT/lib
ENV CGO_CFLAGS -I$VTROOT/dist/vt-zookeeper-3.3.5/include/c-client-src
ENV CGO_LDFLAGS -L$VTROOT/dist/vt-zookeeper-3.3.5/lib
ENV LD_LIBRARY_PATH $VTROOT/dist/vt-zookeeper-3.3.5/lib
# Build Vitess
RUN make build
# If the user doesn't specify a command, load a shell.
CMD ["/bin/bash"]