Add Memcached and libmemcached to the Dockerfile

This commit is contained in:
Cautreoxit 2024-12-26 17:36:47 +08:00 committed by Tate, Hongliang Tian
parent 5df8d59563
commit 7a02affd2a

View File

@ -57,6 +57,9 @@ RUN tar -x -f iozone3_506.tar
RUN git clone -b fio-3.37 https://github.com/axboe/fio.git RUN git clone -b fio-3.37 https://github.com/axboe/fio.git
RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git
RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/mason/schbench.git RUN git clone https://git.kernel.org/pub/scm/linux/kernel/git/mason/schbench.git
RUN wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz \
&& tar -zxvf libmemcached-1.0.18.tar.gz \
&& rm libmemcached-1.0.18.tar.gz
# Build sysbench # Build sysbench
WORKDIR /root/sysbench-1.0.20 WORKDIR /root/sysbench-1.0.20
@ -111,6 +114,13 @@ WORKDIR /root/schbench
RUN make \ RUN make \
&& cp schbench /usr/local/benchmark/ && cp schbench /usr/local/benchmark/
# Build memaslap for memcached
WORKDIR /root/libmemcached-1.0.18
RUN LDFLAGS='-lpthread' CPPFLAGS='-fcommon -fpermissive' CFLAGS='-fpermissive -fcommon' \
./configure --enable-memaslap --prefix=/usr/local/benchmark/libmemcached \
&& CPPFLAGS='-fcommon' make -j \
&& make install
# Clear cached files # Clear cached files
WORKDIR /root WORKDIR /root
RUN rm -rf sysbench-1.0.20 \ RUN rm -rf sysbench-1.0.20 \
@ -122,7 +132,8 @@ RUN rm -rf sysbench-1.0.20 \
iozone3_506 \ iozone3_506 \
fio \ fio \
hackbench \ hackbench \
schbench schbench \
libmemcached-1.0.18
#= Install applications ======================================================= #= Install applications =======================================================
@ -209,6 +220,18 @@ WORKDIR /root
RUN rm -rf nginx-1.26.2.tar.gz \ RUN rm -rf nginx-1.26.2.tar.gz \
nginx-1.26.2 nginx-1.26.2
# Install Memcached v1.6.32
WORKDIR /root
RUN wget https://www.memcached.org/files/memcached-1.6.32.tar.gz \
&& tar -xzvf memcached-1.6.32.tar.gz \
&& cd memcached-1.6.32 \
&& ./configure --prefix=/usr/local/memcached \
&& make -j \
&& make install
RUN rm -rf memcached-1.6.32.tar.gz \
memcached-1.6.32
#= Build syscall test ========================================================= #= Build syscall test =========================================================
FROM build-base as build-bazel FROM build-base as build-bazel
@ -391,6 +414,7 @@ RUN apt update && apt-get install -y --no-install-recommends \
{% endif %} {% endif %}
iptables \ iptables \
iproute2 \ iproute2 \
libevent-dev `# running dependency for Memcached` \
libpixman-1-dev `# running dependency for QEMU` \ libpixman-1-dev `# running dependency for QEMU` \
mtools `# used by grub-mkrescue` \ mtools `# used by grub-mkrescue` \
net-tools \ net-tools \
@ -439,6 +463,7 @@ COPY --from=build-applications /usr/local/nginx /usr/local/nginx
COPY --from=build-applications /usr/local/leveldb /usr/local/leveldb COPY --from=build-applications /usr/local/leveldb /usr/local/leveldb
COPY --from=build-applications /usr/local/speedtest1 /usr/local/benchmark/sqlite-speedtest1 COPY --from=build-applications /usr/local/speedtest1 /usr/local/benchmark/sqlite-speedtest1
COPY --from=build-applications /lib/x86_64-linux-gnu/libsqlite3.so /lib/x86_64-linux-gnu/libsqlite3.so COPY --from=build-applications /lib/x86_64-linux-gnu/libsqlite3.so /lib/x86_64-linux-gnu/libsqlite3.so
COPY --from=build-applications /usr/local/memcached /usr/local/memcached
# Add the path of Asterinas tools # Add the path of Asterinas tools
ENV PATH="/root/asterinas/target/bin:${PATH}" ENV PATH="/root/asterinas/target/bin:${PATH}"