nim-codex/docker
Eric Mastro 5a3b8948b6
first steps towards support for arm64
2023-04-28 14:15:42 +10:00
..
prometheus Docker build (#354) 2023-03-08 12:45:55 +01:00
README.md Support for building docker images with local modifications for the purpose of testing and debugging 2023-04-28 14:15:42 +10:00
buildlocal.bat Support for building docker images with local modifications for the purpose of testing and debugging 2023-04-28 14:15:42 +10:00
buildsetup.bat Support for building docker images with local modifications for the purpose of testing and debugging 2023-04-28 14:15:42 +10:00
codex.Dockerfile fix docker to use new make command (#364) 2023-03-14 16:28:17 -06:00
codex_multiarch.Dockerfile first steps towards support for arm64 2023-04-28 14:15:42 +10:00
docker-compose.yaml first steps towards support for arm64 2023-04-28 14:15:42 +10:00
local.Dockerfile Support for building docker images with local modifications for the purpose of testing and debugging 2023-04-28 14:15:42 +10:00
setup.Dockerfile Support for building docker images with local modifications for the purpose of testing and debugging 2023-04-28 14:15:42 +10:00
startCodex.sh first steps towards support for arm64 2023-04-28 14:15:42 +10:00

README.md

Codex Docker Image

Build and run using the example docker-compose file: docker-compose up -d

Stop and retain image and volume data: docker-compose down

Stop and delete image and volume data: docker-compose down --rmi all -v rm -R hostdatadir

Building local modifications for testing

Sometimes, you just need to make a small change and build a new docker image for the purpose of testing. To speed up this process, the docker build has been cut into two steps. Step 1: (buildsetup.bat) builds the setup.Dockerfile and takes care of the slow process of building the nim buildsystem. This does not need to be re-done for most small changes to the nim-codex codebase. Step 2: (buildlocal.bat) builds the local.Dockerfile and pushes the new image as thatbenbierens/codexlocal:latest.

  • The CI build cannot use this two-step speed-up because it builds images for multiple architectures, which the local scripts don't do.

Environment variables

Codex docker image supports the following environment variables:

  • LISTEN_ADDRS(*)
  • API_BINDADDR(*)
  • DATA_DIR(*)
  • LOG_LEVEL
  • METRICS_ADDR
  • METRICS_PORT
  • NAT_IP
  • API_PORT
  • DISC_IP
  • DISC_PORT
  • NET_PRIVKEY
  • BOOTSTRAP_SPR
  • MAX_PEERS
  • AGENT_STRING
  • STORAGE_QUOTA
  • BLOCK_TTL
  • CACHE_SIZE
  • ETH_PROVIDER
  • ETH_ACCOUNT
  • ETH_DEPLOYMENT

(*) These variables have default values in the docker image that are different from Codex's standard default values.

All environment variables are optional and will default to Codex's CLI default values.

Constants

Codex CLI arguments 'data-dir', 'listen-addrs', and 'api-bindaddr' cannot be configured. They are set to values required for docker in case of bind addresses. In the case of 'data-dir', the value is set to /datadir. It is important that you map this folder to a host volume in your container configuration. See docker-compose.yaml for examples.

Useful

Connect nodes with the /connect endpoint. To get the IP address of a container within a network: Find container Id: docker ps Open terminal in container: docker exec -it <CONTAINER ID> sh Get IP addresses: ifconfig