forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (40 loc) · 1.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:22.04 AS builder
LABEL maintainer="[email protected], [email protected]"
ENV PIKA=/pika \
PIKA_BUILD_DIR=/tmp/pika \
PATH=${PIKA}:${PIKA}/bin:${PATH}
ARG ENABLE_PROXY=false
RUN if [ "$ENABLE_PROXY" = "true" ] ; \
then sed -i 's/http:\/\/archive.ubuntu.com/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list ; \
sed -i 's/http:\/\/ports.ubuntu.com/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list ; \
fi
RUN apt-get update && apt-get install -y \
ca-certificates \
build-essential \
git \
cmake \
autoconf
WORKDIR ${PIKA_BUILD_DIR}
COPY . ${PIKA_BUILD_DIR}
RUN ${PIKA_BUILD_DIR}/build.sh
FROM ubuntu:22.04
ARG ENABLE_PROXY=false
RUN if [ "$ENABLE_PROXY" = "true" ] ; \
then sed -i 's/http:\/\/archive.ubuntu.com/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list ; \
sed -i 's/http:\/\/ports.ubuntu.com/http:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list ; \
fi
RUN apt-get update && apt-get install -y \
ca-certificates \
rsync && \
apt-get clean && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
ENV PIKA=/pika \
PIKA_BUILD_DIR=/tmp/pika \
PATH=${PIKA}:${PIKA}/bin:${PATH}
WORKDIR ${PIKA}
COPY --from=builder ${PIKA_BUILD_DIR}/output/pika ${PIKA}/bin/pika
COPY --from=builder ${PIKA_BUILD_DIR}/entrypoint.sh /entrypoint.sh
COPY --from=builder ${PIKA_BUILD_DIR}/conf/pika.conf ${PIKA}/conf/pika.conf
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 9221
CMD ["/pika/bin/pika", "-c", "/pika/conf/pika.conf"]