From 56f9cf6e31abf6edcad7c7696e4428b68f751a45 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 14 Nov 2023 11:00:01 -0300 Subject: [PATCH 1/3] make it clear that it's the sqlite3 library and not the cli --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c423ba4..c49c44f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Obelisk project is a declarative language designed to help with the implemen - Meson - Ninja - LLVM 14 - - sqlite 3 + - sqlite 3 library and headers(in debian libsqlite3-dev) - C++ 17 - C 17 From c0e93e5e27b724463011293f556a5e5b8b6da9b1 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 14 Nov 2023 13:25:12 -0300 Subject: [PATCH 2/3] add out directory to ignore file for git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e166881..fe79f93 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ builddir !examples/*.obk sqlite/*.c sqlite/*.h +out From fd696a87d473c19065e5793acf040964f4ba2d5c Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Tue, 14 Nov 2023 13:25:38 -0300 Subject: [PATCH 3/3] add docker build and instructions --- .dockerignore | 10 ++++++++++ Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 10 ++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..78ef73d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +README.md +LICENSE +.pre-commit-config.yaml +.gitignore +.clang-format +examples +Dockerfile +build +builddir +out diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb5b60b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ubuntu:22.04 AS build-prep +RUN apt update && apt upgrade -y +RUN apt install -y llvm clangd meson ninja-build pkg-config libsqlite3-dev doxygen graphviz wget unzip +WORKDIR /obelisk +COPY . . +RUN ./sqlite.sh + +FROM build-prep AS build-machine +RUN meson --prefix=/usr build +RUN cd build && ninja -v + +FROM build-machine AS build-machine-intermediate +RUN cd /obelisk/build/src/lib && rm -rf *.h *.p models + +FROM scratch AS obelisk +COPY --from=build-machine-intermediate /obelisk/build/src /bin/ +COPY --from=build-machine-intermediate /obelisk/build/src/lib /lib/ +COPY --from=build-machine-intermediate /obelisk/build/doc/man /man/ +COPY --from=build-machine-intermediate /obelisk/build/doc/html /doc/ +ENTRYPOINT [ "/bin/obelisk" ] + +FROM scratch AS binaries +COPY --from=obelisk /bin/obelisk /bin/ +COPY --from=obelisk /lib /lib/ +COPY --from=obelisk /man /man/ +COPY --from=obelisk /doc /doc/ diff --git a/README.md b/README.md index c49c44f..3eab387 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ The Obelisk project is a declarative language designed to help with the implemen ## Build +### Normal build + ``` ./sqlite.sh meson builddir @@ -24,6 +26,14 @@ This process will generate the binary "obelisk", a shared library "libobelisk.so The binary is used to compile and create obelisk knowledge bases and the the libraries can be linked against to consult the Obelisk knowledge base from any software that can link with the libraries. +### Build in docker image + +``` +docker build ./ --output=out +``` + +This will create a directory called out which will contain the binaries, libraries, and generated documentation. + ## Install ```