Skip to content

Commit 582a889

Browse files
committed
Add dockerfile
1 parent 71a2d11 commit 582a889

4 files changed

Lines changed: 41 additions & 2 deletions

File tree

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
.git/
3+
Dockerfile

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
Cargo.lock
2+
3+
# build script files
4+
build
5+
/build_*
6+
cmake_build
7+
.cmake_build
8+
9+
# buck generated files
10+
.buckd/
11+
.lsp-buck-out/
12+
.lsp.buckd/
13+
buck-out/

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:22.04 as build
2+
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
build-essential \
4+
ca-certificates \
5+
cmake \
6+
curl \
7+
git \
8+
libssl-dev \
9+
ninja-build \
10+
tini \
11+
&& rm -rf /var/lib/apt/lists/*
12+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y
13+
ENV PATH /root/.cargo/bin:$PATH
14+
15+
WORKDIR /dyno-build
16+
COPY . .
17+
RUN scripts/build.sh
18+
19+
FROM ubuntu:22.04 as final
20+
WORKDIR /
21+
COPY --from=build /dyno-build/build/dynolog/src/dynolog /dyno-build/build/release/dyno /opt/dyno/
22+
COPY --from=build /usr/bin/tini /tini
23+
ENTRYPOINT ["/tini", "--"]
24+
CMD ["/opt/dyno/dynolog", "--enable_ipc_monitor"]

scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -eux -o pipefail
1111

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

@@ -20,7 +20,7 @@ echo "Running cmake"
2020
mkdir -p build; cd build;
2121

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

2626
echo "Binary files ="

0 commit comments

Comments
 (0)