ARG OCCLUM_VERSION
FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base
LABEL maintainer="Chunyang Hui <sanqian.hcy@antgroup.com>"

ARG OCCLUM_BRANCH
WORKDIR /root
RUN rm -rf /root/demos && \
    git clone -b $OCCLUM_BRANCH https://github.com/occlum/occlum.git && \
    cp -r occlum/demos /root/demos && \
    rm -rf /root/occlum

WORKDIR /root/demos/grpc/grpc_musl
RUN bash -x download_and_install_openssl.sh && \
    bash -x download_and_install_grpc.sh

WORKDIR /root/demos/grpc/grpc_glibc
RUN bash -x download_and_install_grpc_glibc.sh && \
    bash -x prepare_stress_test_tool.sh

WORKDIR /root
