forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker multi-stage build to reduce the docker image size
- Loading branch information
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]" | ||
|
||
|
@@ -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"] |