This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
forked from tenzir/tenzir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
101 lines (82 loc) · 3.6 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ARG DOCKER_BUILD=build
# build image, install build-dependencies and build vast
FROM debian:buster-backports as build
LABEL builder=true
LABEL maintainer="[email protected]"
ENV PREFIX /usr/local
ENV CC gcc-8
ENV CXX g++-8
ENV BUILD_TYPE Release
ENV BUILD_DIR /tmp/src
# Compiler and dependency setup
RUN apt-get -qq update && apt-get -qqy install \
build-essential gcc-8 g++-8 ninja-build libbenchmark-dev libpcap-dev tcpdump \
libssl-dev python3-dev python3-pip python3-venv git-core jq gnupg2 wget \
libyaml-cpp-dev libsimdjson-dev libflatbuffers-dev flatbuffers-compiler-dev \
lsb-release ca-certificates
# Need to specify backports explicitly, since spdlog and fmt also have regular
# buster packages. Also, this comes with a newer version of CMake.
RUN apt-get -qqy -t buster-backports install cmake libspdlog-dev libfmt-dev
# Apache Arrow (c.f. https://arrow.apache.org/install/)
RUN wget https://apache.bintray.com/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \
apt-get -qqy install ./apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \
apt-get -qq update && \
apt-get -qqy install libarrow-dev
# VAST
WORKDIR $BUILD_DIR/vast
COPY cmake ./cmake
COPY doc ./doc
COPY libvast ./libvast
COPY libvast_test ./libvast_test
COPY examples ./examples
COPY schema ./schema
COPY scripts ./scripts
COPY tools ./tools
COPY vast ./vast
COPY .clang-format .cmake-format LICENSE LICENSE.3rdparty README.md BANNER CMakeLists.txt configure vast.yaml.example ./
RUN ./configure \
--prefix=$PREFIX \
--build-type=$BUILD_TYPE \
--log-level=INFO \
--generator=Ninja
RUN cmake --build build --parallel
RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
RUN cmake --build build --target integration
RUN cmake --build build --target install
# copy prebuilt image
FROM debian:buster-backports as prebuilt
ENV PREFIX /usr/local
RUN apt-get -qq update && apt-get -qqy install rsync
COPY opt/vast /opt/vast
RUN rsync -avh /opt/vast/* $PREFIX
# "Hack": Docker does not allow to use COPY --from=${BUILD_ARG}, but we can name
# a build stage after the contents of a build-arg and then use the stage as
# argument in COPY --from="stage"
FROM $DOCKER_BUILD as build_type
# Production image: copy application
FROM debian:buster-backports
ENV PREFIX /usr/local
COPY --from=build_type $PREFIX/ $PREFIX/
RUN apt-get -qq update && apt-get -qq install -y libc++1 libc++abi1 libpcap0.8 \
openssl libsimdjson4 libyaml-cpp0.6 libasan5 libflatbuffers1 wget gnupg2 \
lsb-release ca-certificates
# Need to specify backports explicitly, since spdlog and fmt also have regular
# buster packages. For fmt we install the dev package, because libfmt is only
# packaged for bullseye:
# https://packages.debian.org/search?keywords=libfmt&searchon=names&suite=all§ion=all
RUN apt-get -qqy -t buster-backports install libspdlog1 libfmt-dev
# Apache Arrow (c.f. https://arrow.apache.org/install/)
RUN wget https://apache.bintray.com/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \
apt-get -qqy install ./apache-arrow-archive-keyring-latest-$(lsb_release --codename --short).deb && \
apt-get -qq update && \
apt-get -qqy install libarrow-dev
EXPOSE 42000/tcp
RUN echo "Adding vast user" && useradd --system --user-group vast
RUN mkdir -p /etc/vast /var/log/vast /var/lib/vast
COPY systemd/vast.yaml /etc/vast/vast.yaml
RUN chown -R vast:vast /var/log/vast /var/lib/vast
WORKDIR /var/lib/vast
VOLUME ["/var/lib/vast"]
USER vast:vast
ENTRYPOINT ["vast"]
CMD ["--help"]