FROM ubuntu:20.04

LABEL maintainer="996442717qqcom@gmail.com"

ENV ZEUS  /opt/zeus
ENV ZEUS_BUILD_DIR /tmp/zeus
ENV PATH ${ZEUS}/bin:${PATH}

COPY . ${ZEUS_BUILD_DIR}

WORKDIR ${ZEUS_BUILD_DIR}

RUN echo "Begin package ZEUS ..."

RUN mkdir -p ${ZEUS}/framework

RUN apt-get update -y && \
    apt-get install -y make autoconf libtool && \
    apt-get install -y gcc g++ && \
    apt-get install -y libreadline-dev && \
    apt-get install -y libssl-dev && \
    apt-get install -y libfaketime && \
    apt-get install -y google-perftools && \
    apt-get install -y libgoogle-perftools-dev && \
    apt-get install -y rlwrap && \
    cd ${ZEUS_BUILD_DIR}/framework/ && \
    make PLAT=linux && \
    cp -r ${ZEUS_BUILD_DIR}/framework/ ${ZEUS}/framework && \
    rm -rf ${ZEUS}/framework/3rd && \
    rm -rf ${ZEUS}/framework/lualib && \
    rm -rf ${ZEUS_BUILD_DIR} && \
    apt-get remove -y --purge make autoconf libtool && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR ${ZEUS}

CMD ["sh", "-c", "${ZEUS}/framework/skynet/skynet ${ZEUS}/framework/skynet/example/config"]

# 打包
# docker build . -t cloudfreexiao/zeus:latest

# 删除所有 容器和镜像 
# docker stop $(docker ps -a -q) && docker system prune --all --force