-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update(ci): update ci jobs to generate Falco images with modern probe
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
- Loading branch information
1 parent
2b3b543
commit ae51c03
Showing
3 changed files
with
123 additions
and
56 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Builder folder | ||
|
||
* We use `Dockerfile` to build the `centos7` Falco builder image. | ||
* We use `modern-falco-builder.Dockerfile` to build Falco with the modern probe and return it as a Dockerfile output. This Dockerfile doesn't generate a Docker image but returns as output (through the `--output` command): | ||
* Falco `tar.gz`. | ||
* Falco `deb` package. | ||
* Falco `rpm` package. | ||
* Falco build directory, used by other CI jobs. |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
FROM centos:7 AS build-stage | ||
|
||
# To build Falco you need to pass the cmake option | ||
ARG CMAKE_OPTIONS="" | ||
ARG MAKE_JOBS=4 | ||
|
||
# Install all the dependencies | ||
WORKDIR / | ||
|
||
RUN yum -y install centos-release-scl; \ | ||
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++; \ | ||
source scl_source enable devtoolset-8; \ | ||
yum install -y git wget make m4 rpm-build | ||
|
||
# With some previous cmake versions it fails when downloading `zlib` with curl in the libs building phase | ||
RUN curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz; \ | ||
gzip -d /tmp/cmake.tar.gz; \ | ||
tar -xpf /tmp/cmake.tar --directory=/tmp; \ | ||
cp -R /tmp/cmake-3.22.5-linux-$(uname -m)/* /usr; \ | ||
rm -rf /tmp/cmake-3.22.5-linux-$(uname -m)/ | ||
|
||
# Copy Falco folder from the build context | ||
COPY . /source | ||
WORKDIR /build/release | ||
|
||
# We need `make tests` and `make all` for integration tests. | ||
RUN source scl_source enable devtoolset-8; \ | ||
cmake ${CMAKE_OPTIONS} /source; \ | ||
make falco -j${MAKE_JOBS}; \ | ||
make package; \ | ||
make tests -j${MAKE_JOBS}; \ | ||
make all -j${MAKE_JOBS} | ||
|
||
FROM scratch AS export-stage | ||
|
||
ARG DEST_BUILD_DIR="/build" | ||
|
||
COPY --from=build-stage /build/release/falco-*.tar.gz /packages/ | ||
COPY --from=build-stage /build/release/falco-*.deb /packages/ | ||
COPY --from=build-stage /build/release/falco-*.rpm /packages/ | ||
COPY --from=build-stage /build/release/ ${DEST_BUILD_DIR} |