forked from gitpod-io/workspace-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (49 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
58 lines (49 loc) · 2.08 KB
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
ARG base
FROM ${base}
# Added for dazzle as it does not rebuild a layer until one of its lines are changed. Increase this counter to rebuild this layer.
ENV TRIGGER_REBUILD=1
ARG YB_VERSION
ARG YB_BUILD
ARG YB_BIN_PATH=/usr/local/yugabyte
ARG ROLE=gitpod
ARG PYTHON_VERSION
USER $ROLE
# create bin and data path
RUN sudo mkdir -p $YB_BIN_PATH \
&& sudo mkdir -p /var/ybdp
# set permission
RUN sudo chown -R $ROLE:$ROLE /var/ybdp \
&& sudo chown -R $ROLE:$ROLE /usr/local/yugabyte
# fetch the binary
RUN curl -sSLo ./yugabyte.tar.gz https://downloads.yugabyte.com/releases/${YB_VERSION}/yugabyte-${YB_VERSION}-b${YB_BUILD}-linux-x86_64.tar.gz \
&& tar -xvf yugabyte.tar.gz -C $YB_BIN_PATH --strip-components=1 \
&& chmod +x $YB_BIN_PATH/bin/* \
&& rm ./yugabyte.tar.gz
# python is a required dependency of ycqlsh
# when building yugabyte combos, if our base is full, related python chunk tests fail
# so, use base as the combo ref, add chunks, but ignore Python chunk and install manually
ENV PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
ENV PYENV_ROOT="$HOME/.pyenv"
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv \
# v2.6.20
&& git -C ~/.pyenv checkout 3441980e83bb1c5fdb2f1734ae4dab694d10ef71 \
&& pyenv install ${PYTHON_VERSION} \
&& pyenv global ${PYTHON_VERSION}
# configure the interpreter
RUN ["/usr/local/yugabyte/bin/post_install.sh"]
# set the execution path and other env variables
ENV PATH="$YB_BIN_PATH/bin/:$PATH"
ENV HOST=127.0.0.1
ENV STORE=/var/ybdp
ENV YSQL_PORT=5433
ENV YCQL_PORT=9042
ENV WEB_PORT=7000
ENV TSERVER_WEB_PORT=9000
ENV YSQL_API_PORT=13000
ENV YCQL_API_PORT=12000
ENV YUGABYTED_UI=15433
# re-initialization is automatically handled
RUN echo "\n# yugabytedb start command" >> /home/gitpod/.bashrc.d/100-yugabyedb-launch
RUN echo "[[ -f \${GITPOD_REPO_ROOT}/.nopreload ]] || yugabyted start --base_dir=$STORE --listen=$HOST > /dev/null" >> /home/gitpod/.bashrc.d/100-yugabyedb-launch
RUN chmod +x /home/gitpod/.bashrc.d/100-yugabyedb-launch
EXPOSE ${YSQL_PORT} ${YCQL_PORT} ${WEB_PORT} ${TSERVER_WEB_PORT} ${YSQL_API_PORT} ${YCQL_API_PORT} ${YUGABYTED_UI}