-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
158 lines (141 loc) · 4.42 KB
/
Dockerfile
File metadata and controls
158 lines (141 loc) · 4.42 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Use Ubuntu 20.04 as the base image
FROM ubuntu:20.04
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install base build dependencies and Python
RUN apt-get update && apt-get install -y \
g++ \
make \
cmake \
wget \
curl \
libgmp-dev \
libssl-dev \
libboost-all-dev \
git \
netcat-openbsd \
htop \
bc \
nano \
tmux \
parallel \
iproute2 \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Install Ansible
RUN pip3 install ansible
# Install Go 1.23.4
RUN wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz && \
rm go1.23.4.linux-amd64.tar.gz
# Set Go environment variables
ENV GOROOT="/usr/local/go"
ENV GOPATH="/go"
ENV PATH="/usr/local/go/bin:/go/bin:${PATH}"
# Create Go workspace
RUN mkdir -p /go/src /go/bin /go/pkg
# Install Redis using official Redis repository
RUN apt-get update && \
apt-get install -y lsb-release curl gpg && \
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg && \
chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list && \
apt-get update && \
apt-get install -y redis && \
rm -rf /var/lib/apt/lists/*
# Install all Thrift dependencies
RUN apt-get update && \
apt-get install -y \
automake \
bison \
flex \
g++ \
git \
libboost-all-dev \
libevent-dev \
libssl-dev \
libtool \
make \
pkg-config \
libglib2.0-dev \
default-jdk \
ant \
nodejs \
npm \
php-dev \
ruby \
ruby-dev \
python3-dev \
python3-pip \
python3-setuptools \
python3-twisted \
mono-complete \
erlang-base \
erlang-eunit \
erlang-dev \
erlang-tools \
lua5.2 \
lua5.2-dev \
perl \
libbit-vector-perl \
libclass-accessor-class-perl \
&& rm -rf /var/lib/apt/lists/*
# Install Apache Thrift 0.22.0 from source
RUN cd /tmp && \
wget https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz && \
tar -xzf thrift-0.22.0.tar.gz && \
cd thrift-0.22.0 && \
./configure --prefix=/usr/local \
--enable-libtool-lock \
--with-cpp \
--with-go \
--without-java \
--without-python \
--without-nodejs \
--without-php \
--without-ruby \
--without-perl \
--without-csharp \
--without-erlang \
--without-lua \
--without-dart \
--without-swift \
--without-rs \
--disable-tests \
--disable-tutorial && \
make -j$(nproc) && \
make install && \
cd .. && \
rm -rf thrift-0.22.0 thrift-0.22.0.tar.gz && \
ldconfig
# Set the working directory
WORKDIR /app
# Copy the entire ObliSQL repository from the build context into /app
COPY . /app/
# Build Waffle
RUN cd /app/waffle && sh build.sh
# Build CMD components
RUN cd /app/cmd && chmod +x ./build.sh && ./build.sh
# Set up Redis configuration for ObliSQL
RUN mkdir -p /etc/redis /var/lib/redis && \
echo "bind 0.0.0.0" > /etc/redis/redis.conf && \
echo "port 6379" >> /etc/redis/redis.conf && \
echo "daemonize no" >> /etc/redis/redis.conf && \
echo "dir /var/lib/redis" >> /etc/redis/redis.conf && \
echo "protected-mode no" >> /etc/redis/redis.conf
# Expose ports for ObliSQL services
EXPOSE 6379 9090 9500 9600 9900
# Verify all installations and builds
RUN echo "=== ObliSQL Build Verification ===" && \
echo "✅ CMake: $(cmake --version | head -1)" && \
echo "✅ Go: $(go version)" && \
echo "✅ Redis: $(redis-server --version | head -1)" && \
echo "✅ Thrift: $(thrift --version)" && \
echo "✅ Ansible: $(ansible --version | head -1)" && \
echo "✅ Waffle executables:" && \
ls -la /app/waffle/bin/ && \
echo "✅ CMD executables:" && \
ls -la /app/cmd/batchManager/batchManager /app/cmd/benchmark/benchmark /app/cmd/resolver/resolver /app/cmd/oramExecutor/oramExecutor /app/cmd/plainTextExectutor/plainTextExectutor 2>/dev/null || echo "CMD executables built successfully"
# Default command starts bash
CMD ["bash"]