2.6. Start with the Docker Development Environment

2.6.1. Why use docker development environment

PikaScript’s kernel and standard libraries are developed in a docker environment, which can be prone to some hard-to-debug problems when developing features that involve the kernel internals, such as

  • memory leaks

  • memory overruns

  • broken kernel functionality

This problem can be avoided by using PikaScript’s docker development environment, which has been installed with unit testing framework and memory checking tool, so that if there is a memory security problem, it can be quickly found and solved to avoid memory hazards.

PikaScript’s linux development platform also needs to install go, rust, GoogleTest, GoogleBenchmark, valgrind and other tools, which is rather cumbersome, Docker-based development environment can install these tools in one click, and ensure that all developers’ development environment is consistent.

2.6.2. Build Docker container

Please make sure you have installed Docker on the host:

  • Install Docker directly on Linux platform

  • Install Docker-Desktop on Windows platform

    • Docker-Desktop requires the installation of wsl2

(For windows platform, you can use the following command in wsl, not PowerShell)

step1: Clone the repository

  1. git clone https://github.com/pikastech/pikascript
  2. cd pikascript/docker

step2: Build the Docker image, then start the container

  1. bash build.sh
  2. sh run.sh

step3: Initialize the port/linux

  1. cd port/linux
  2. sh pull-core.sh
  3. sh init.sh

step4: Run GoogleTest, BenchMark, and valgrind

  1. sh gtest.sh
  2. sh ci_benchmark.sh
  3. sh valgrind.sh

step5: Run REPL

  1. sh run.sh

For more development guidelines under Docker, please refer to Development Process for Standard Libraries.