Running commands to customise environment

Katacoda environments are pre-configured with the base configuration, for example , Docker or Kubernetes. Commands can be run in the background when the user connects that allow the environment to be customised. Files from the directory can also be uploaded.

Running Commands

Bash scripts defined in courseData will run in the background when the user begins that step. For intro, this means the commands will run when the environment becomes available. For steps, this is when the user starts the step. This is perfect for configuring scenarios and environments to help guide the user.

Bash scripts defined in code work the same as courseData but will run in the foreground.

Uploading Files

Files in a assets directory within the scenario can have files uploaded to the client or host of the environment.

Index.json Example

"details": {
  "intro": {
    "courseData": "courseBase.sh",
  },
  "assets": {
    "client": [
      {
        "file": "docker-compose.yml",
        "target": "~/"
      }
    ],
    "host01": [
      {
        "file": "config.yml",
        "target": "~/"
      }
    ]
  }
}
    
Additional Information

Understanding Katacoda's index.json