Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhulgakov committed Nov 18, 2022
1 parent 71a2d11 commit 5b4bb8c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
.git/
Dockerfile
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
Cargo.lock

# build script files
build
/build_*
cmake_build
.cmake_build

# buck generated files
.buckd/
.lsp-buck-out/
.lsp.buckd/
buck-out/
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:22.04 as dev-base
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
ca-certificates \
git \
curl \
libssl-dev \
ninja-build && \
rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y
ENV PATH /root/.cargo/bin:$PATH

FROM dev-base as build
WORKDIR /dyno-build
COPY . .
RUN scripts/build.sh

FROM ubuntu:22.04 as final
WORKDIR /opt/dyno
COPY --from=build /dyno-build/build/dynolog/src/dynolog /dyno-build/build/release/dyno ./
CMD ["/opt/dyno/dynolog", "--enable_ipc_monitor"]
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -eux -o pipefail

# Check dependencies
cmake --version || echo "Please install cmake for your platform using dnf/apt-get etc."
ninja-build --version || echo "Please install ninja for your platform using dnf/apt-get etc."
ninja --version || echo "Please install ninja for your platform using dnf/apt-get etc."
rustc --version || echo "Please install Rust and Cargo - see https://www.rust-lang.org/tools/install"
cargo --version || echo "Please install Rust and Cargo - see https://www.rust-lang.org/tools/install"

Expand All @@ -20,7 +20,7 @@ echo "Running cmake"
mkdir -p build; cd build;

# note we can build without ninja if not available on this system
cmake -DCMAKE_BUILD_TYPE=Release -G=Ninja "$@" ..
cmake -DCMAKE_BUILD_TYPE=Release -GNinja "$@" ..
cmake --build .

echo "Binary files ="
Expand Down

0 comments on commit 5b4bb8c

Please sign in to comment.