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 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 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
WORKDIR /root/sysbench-1.0.20
@ -111,6 +114,13 @@ WORKDIR /root/schbench
RUN make \
&& 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
WORKDIR /root
RUN rm -rf sysbench-1.0.20 \
@ -122,7 +132,8 @@ RUN rm -rf sysbench-1.0.20 \
iozone3_506 \
fio \
hackbench \
schbench
schbench \
libmemcached-1.0.18
#= Install applications =======================================================
@ -209,6 +220,18 @@ WORKDIR /root
RUN rm -rf nginx-1.26.2.tar.gz \
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 =========================================================
FROM build-base as build-bazel
@ -391,6 +414,7 @@ RUN apt update && apt-get install -y --no-install-recommends \
{% endif %}
iptables \
iproute2 \
libevent-dev `# running dependency for Memcached` \
libpixman-1-dev `# running dependency for QEMU` \
mtools `# used by grub-mkrescue` \
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/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 /usr/local/memcached /usr/local/memcached
# Add the path of Asterinas tools
ENV PATH="/root/asterinas/target/bin:${PATH}"