Skip to content

Development Container

The development container is an OCI that you can run with Docker or other container runtimes. It provides a copy of the game, with the script already loaded into it. This allows you to make changes to the script, and quickly evaluate these changes, without having to build a userscript and load that into your userscript manager.

[!IMPORTANT] The Kitten Science Development Containers are not to be confused with VS Code Dev Containers. Kitten Science tries to be agnostic about development environments, and does not directly support features exclusive to VS Code.

Quick Start

The easiest way to get started is to just run the published OCI as-is.

sudo docker run \
    ghcr.io/kitten-science/devcontainer:nightly
podman run \
    ghcr.io/kitten-science/devcontainer:nightly

Of course, this won't help you much with development, as the source code in the container is static. Read the further examples to see how to add more functionality.

Full Background Example

More commonly, you will spawn the development container as a background task (--detach), and mount your local overlay output directory into the container.

sudo docker run \
    --detach \
    --mount type=bind,source="devcontainer/overlay",target=/kittensgame/overlay \
    --name devcontainer \
    --publish 8080 \
    --publish 8086 \
    --replace \
    ghcr.io/kitten-science/devcontainer:nightly
podman run \
    --detach \
    --mount type=bind,source="devcontainer/overlay",target=/kittensgame/overlay \
    --name devcontainer \
    --publish 8080 \
    --publish 8086 \
    --replace \
    ghcr.io/kitten-science/devcontainer:nightly

Publish Ports

The container exposes these ports:

  1. 8080 - HTTP Browser interface
  2. 8086 - WebSocket Browser interface
sudo docker run \
    --publish 9080:8080 \
    --publish 9086:8086 \
    ghcr.io/kitten-science/devcontainer:nightly
podman run \
    --publish 9080:8080 \
    --publish 9086:8086 \
    ghcr.io/kitten-science/devcontainer:nightly

Use Local Output

sudo docker run \
    --mount type=bind,source="devcontainer/overlay",target=/kittensgame/overlay \
    ghcr.io/kitten-science/devcontainer:nightly
podman run \
    --mount type=bind,source="devcontainer/overlay",target=/kittensgame/overlay \
    ghcr.io/kitten-science/devcontainer:nightly

Use Local OCI (Advanced)

The container itself is not very complicated, and rarely needs to be built locally.

make devcontainer-oci
sudo docker run \
    localhost/devcontainer:latest
make devcontainer-oci
podman run \
    localhost/devcontainer:latest

Clean Up

sudo docker stop devcontainer
sudo docker rm devcontainer
podman stop devcontainer
podman rm devcontainer

Using the Kitten Analysts Development Container

todo

Running the Kitten Analysts Backend

todo