Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
target/
wit/
**/target/
**/wit/
**/*.wasm
.vscode
.app-signing
.DS_Store
*.swp
*.swo
*.zip
/home
packages/**/pkg/*.wasm
packages/**/wit
*/**/node_modules
.env
kinode/src/bootstrapped_processes.rs
kinode/packages/**/wasi_snapshot_preview1.wasm

LICENSE
pull_request_template.md
README.md
Dockerfile
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# syntax=docker/dockerfile:1
FROM rust AS builder

COPY . /tmp/source

WORKDIR /tmp/source

RUN apt-get update
RUN apt-get install clang -y

RUN cargo install wasm-tools && \
rustup install nightly && \
rustup target add wasm32-wasi && \
rustup target add wasm32-wasi --toolchain nightly && \
cargo install cargo-wasi

RUN cargo +nightly build -p kinode --release

FROM debian:12-slim

RUN apt-get update
RUN apt-get install openssl -y

COPY --from=builder /tmp/source/target/release/kinode /bin/kinode

ENV LD_LIBRARY_PATH=/lib
ENV RUST_BACKTRACE=full
ENTRYPOINT [ "/bin/kinode" ]
CMD [ "/kinode-home" ]

EXPOSE 8080
EXPOSE 9000
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,25 @@ Download and install an app:
m our@main:app_store:sys '{"Download": {"package": {"package_name": "<pkg>", "publisher_node": "<node>"}, "install_from": "<node>"}}'
m our@main:app_store:sys '{"Install": {"package_name": "<pkg>", "publisher_node": "<node>"}}'
```

## Running as a Docker container

This image expects a volume mounted at `/kinode-home`. This volume may be empty or may contain another Kinode's data. It will be used as the home directory of your Kinode.

The image includes EXPOSE directives for TCP port `8080` and TCP port `9000`. Port `8080` is used for serving the Kinode web dashboard over HTTP, and it may be mapped to a different port on the host. Port `9000` is optional and is only required for a direct node.

If you are running a direct node, you must map port `9000` to the same port on the host and on your router. Otherwise, your Kinode will not be able to connect to the rest of the network as connection info is written to the chain, and this information is based on the view from inside the Docker container.

To build a local Docker image, run the following command in this project root.
```
docker build -t 0xlynett/kinode .
```

For example:
```
docker volume create kinode-volume

docker run -d -p 8080:8080 -it --name my-kinode \
--mount type=volume,source=kinode-volume,destination=/kinode-home \
0xlynett/kinode
```