Skip to content

Commit

Permalink
Updates README
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Feb 18, 2025
1 parent bb523b0 commit c162d58
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# syntax=docker/dockerfile:1

# =========== 1) BUILD STAGE =============
FROM ubuntu:24.04 AS builder

# Install dependencies needed to build trueblocks-khedra
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git

# Create and change to the source directory
WORKDIR /app

# Copy source into the container
COPY . /app

# Build the project
RUN mkdir build && cd build && cmake .. && make

# =========== 2) FINAL STAGE =============
FROM ubuntu:22.04

# Copy compiled binary from the builder stage
COPY --from=builder /app/build/khedra /usr/local/bin/khedra

# Copy example config (you can move or rename as preferred)
COPY --from=builder /app/config.example /root/.trueblocks/trueblocks-khedra.conf

# Set environment variables or defaults for Khedra
ENV KHEDRA_CONFIG=/root/.trueblocks/trueblocks-khedra.conf \
KHEDRA_DATA_DIR=/root/.trueblocks/data \
KHEDRA_LOG_LEVEL=INFO

# Default entrypoint runs 'khedra'
ENTRYPOINT ["khedra"]
# Default command shows help text
CMD ["--help"]
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,27 @@ Refer to the sample configuration file (`.conf.example`) in this repo for a temp

---

## Docker Version
## Docker Version - Building & Running

<!--
BEGIN SECTION: (Exact text from trueblocks-core README)
Copy/Paste the "Docker Version" section here verbatim.
-->
Build the Docker image:

```bash
docker build -t trueblocks-khedra .
```

Run the Docker container (showing the help message by default):

```bash
docker run --rm -it trueblocks-khedra
```

Use a custom command, for example to specify a subcommand or different flags:

```bash
docker run --rm -it trueblocks-khedra some-subcommand --flag
```

**(Paste the *exact* Docker Version text from the trueblocks-core README here.)**
Adjust paths, environment variables, or your config file strategy as needed. You can also mount external volumes (e.g., a local ~/.trueblocks directory) if you prefer to maintain data outside the container.

---

Expand Down

0 comments on commit c162d58

Please sign in to comment.