Skip to content

Commit

Permalink
Use docker multi-stage build to reduce the docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
c93614 committed May 21, 2021
1 parent e51a7d6 commit ee9a029
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM centos:7
FROM centos:7 as builder

LABEL maintainer="[email protected], [email protected]"

Expand Down Expand Up @@ -34,7 +34,16 @@ RUN rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm &&
yum -y remove git && \
yum -y clean all

FROM centos:7
ENV PIKA /pika
ENV PATH ${PIKA}:${PIKA}/bin:${PATH}

RUN set -eux; yum install -y epel-release; \
yum install -y snappy protobuf gflags glog bzip2 zlib lz4 libzstd rsync; \
yum clean all;

WORKDIR ${PIKA}
COPY --from=builder $PIKA ./

ENTRYPOINT ["/pika/entrypoint.sh"]
CMD ["/pika/bin/pika", "-c", "/pika/conf/pika.conf"]

0 comments on commit ee9a029

Please sign in to comment.