forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dockerfile.tpl
47 lines (35 loc) · 1.03 KB
/
dockerfile.tpl
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
ARG bootstrap_version=14.1
ARG image="vitess/bootstrap:${bootstrap_version}-{{.Platform}}"
FROM "${image}"
USER root
# Re-copy sources from working tree
RUN rm -rf /vt/src/vitess.io/vitess/*
COPY . /vt/src/vitess.io/vitess
{{if .InstallXtraBackup}}
# install XtraBackup
RUN wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
RUN apt-get update
RUN apt-get install -y gnupg2
RUN dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
RUN apt-get update
RUN apt-get install -y percona-xtrabackup-24
{{end}}
# Set the working directory
WORKDIR /vt/src/vitess.io/vitess
# Fix permissions
RUN chown -R vitess:vitess /vt
USER vitess
# Set environment variables
ENV VTROOT /vt/src/vitess.io/vitess
# Set the vtdataroot such that it uses the volume mount
ENV VTDATAROOT /vt/vtdataroot
# create the vtdataroot directory
RUN mkdir -p $VTDATAROOT
# install goimports
RUN go install golang.org/x/tools/cmd/goimports@latest
{{if .MakeTools}}
# make tools
RUN make tools
{{end}}
# sleep for 50 minutes
CMD sleep 3000