forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (44 loc) · 1.75 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
59
60
61
62
63
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} \
BUILD_TYPE=RelWithDebInfo
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 \
clang-tidy-12
WORKDIR ${PIKA_BUILD_DIR}
COPY . ${PIKA_BUILD_DIR}
RUN cmake -B ${PIKA_BUILD_DIR}/build -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DUSE_PIKA_TOOLS=OFF
RUN cmake --build ${PIKA_BUILD_DIR}/build --config ${BUILD_TYPE}
FROM ubuntu:22.04
LABEL maintainer="[email protected], [email protected]"
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}/build/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"]