forked from sql-machine-learning/sqlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
60 lines (46 loc) · 1.98 KB
/
Dockerfile.dev
File metadata and controls
60 lines (46 loc) · 1.98 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
59
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y git wget curl bzip2 build-essential
# Miniconda - Python 3.6, 64-bit, x86, latest
ARG CONDA_OS=Linux
RUN curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o mconda-install.sh && \
bash -x mconda-install.sh -b -p miniconda && \
rm mconda-install.sh
ENV PATH="/miniconda/bin:$PATH"
ARG CONDA_ADD_PACKAGES=""
RUN conda create -y -q -n sqlflow-dev python=3.6 ${CONDA_ADD_PACKAGES}
RUN echo ". /miniconda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "source activate sqlflow-dev" >> ~/.bashrc
ARG PIP_ADD_PACKAGES=""
RUN /bin/bash -c "source activate sqlflow-dev && python -m pip install \
grpcio-tools \
tensorflow==2.0.0-alpha0 \
mysql-connector-python \
pyhive \
${PIP_ADD_PACKAGES} \
"
RUN wget --quiet https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.11.5.linux-amd64.tar.gz
RUN rm go1.11.5.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin
RUN wget --quiet https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
RUN apt-get install -y unzip
RUN unzip -qq protoc-3.6.1-linux-x86_64.zip -d /usr/local
RUN rm protoc-3.6.1-linux-x86_64.zip
RUN mkdir -p /go
ENV GOPATH /go
RUN go get github.com/golang/protobuf/protoc-gen-go
RUN mv /go/bin/protoc-gen-go /usr/local/bin/
RUN apt-get install -y sqlite3 libsqlite3-dev
# install mysql without a password prompt
RUN ["/bin/bash", "-c", "debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'"]
RUN ["/bin/bash", "-c", "debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'"]
RUN apt-get -y install mysql-server
VOLUME /var/lib/mysql
RUN echo "#!/bin/bash" > /build.sh
RUN echo "go generate -v ./..." >> /build.sh
RUN echo "go install -v ./..." >> /build.sh
RUN chmod +x /build.sh
CMD ["/build.sh"]
# Make sqlflow-dev pyenv the default Python environment
ENV PATH=/miniconda/envs/sqlflow-dev/bin:$PATH