Skip to content

Add Dockerfile #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:22.04 as build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
git \
libssl-dev \
ninja-build \
tini \
&& 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

WORKDIR /dyno-build
COPY . .
RUN scripts/build.sh

FROM ubuntu:22.04 as final
WORKDIR /
COPY --from=build /dyno-build/build/dynolog/src/dynolog /dyno-build/build/release/dyno /opt/dyno/
COPY --from=build /usr/bin/tini /tini
ENTRYPOINT ["/tini", "--"]
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