Skip to main content

How to Build Projects With Container Craft Dev Container and Runme

Runme badge

Runme interactive notebook provides an easy way for developers and operations teams to manage workflows and document processes. With the Runme extension, users can access a user-friendly interactive Notebook and build their projects within a pre-configured DevContainer.

In this guide, we will walk through setting up the ContainerCraft DevContainer repository as your development environment in Runme. Here, you will also learn how to create instructions for testing your projects directly inside the container. This setup ensures that your development and testing are all in a unified document.

Prerequisites

To get started, ensure you have the following installed on your local machine:

  • Runme: Runme provides various client interfaces for accessing the Runme Notebook. For this guide, we will be using Runme on VS Code. With Runme installed on your code editor, you can proceed to set Runme as your default Markdown viewer
  • Docker: Ensure you have Docker installed and running on your machine.
  • VS Code Remote—Containers Extension: Install the VS Code Remote—Containers Extension to work with containers directly in VS Code.

Setting Up Your Dev Container

In this section, we will walk you through how to access your project repository in the ContainerCraft Dev Container in VS Code, test your project inside the dev container, and leverage Runme’s features to build your projects faster and easier.

Clone the Repository

Start by cloning the ContainerCraft/devcontainer repository to your local machine:

git clone https://github.com/ContainerCraft/devcontainer.git

Access the Repository in VS Code

  1. Open Visual Studio Code.
  2. You can access the command palette by pressing Ctrl+Shift+P (or Cmd+Shift+P on Mac) and searching for Remote-Explorer: Focus on Dev Containers.

remote-explorer

  1. Select the folder where you cloned the repository.

dev-containers

Rebuild and Open the Container

  • VS Code should prompt you to reopen the folder in a container. If it doesn’t, open the command palette again and select Remote-Explorer: Focus on Dev Containers....
  • VS Code will build the Docker container defined in the .devcontainer folder and open the workspace inside the container once the build is complete.

dev container ui

Test Your Project Inside the Dev Container

Your container environment is set up with pre-configured tools and config required for DevOps, including Runme, Kubernetes, Helm, Kubectl, K9s, Tmux, Python, Go, and more. You can use these tools directly within the VS Code terminal, which runs inside the container.


Add Your Project Files

To add your project files to the dev container workspace, copy them into the cloned repository folder or mount an additional volume in the devcontainer.json file.

cp -r ~/my-project/* .

The command above copies your project to the workspace. Alternatively, you can clone your project into the dev container.

git clone https://github.com/username/repository.git

After adding your project files to the folder, you can leverage Runme to easily build your projects with ContainerCraft DevContainer using any language you choose. This is made possible with the Shebang support feature. This allows you to easily set the code block of the specific programming language you intend to use.


You can also add and run the different supported languages in one Markdown file.

When building projects, you may need to execute a command and move to the next command quickly. However, you may get stuck because the previous command still needs to be executed, and you cannot move on. Runme’s background task feature solves this issue! With the background task, you can execute commands and move on to the next.


Runme also makes your Markdown file more organized and user-friendly.

runme ui

You can easily build your entire project with the CotainerCraft DevContainer using all the existing features of Runme. Here is an example of how to handle large data efficiently with Node.js streams.


Customize the Environment

If your project requires additional tools or dependencies:

  • Edit the Dockerfile or devcontainer.json in the .devcontainer folder to include what’s needed.
  • Rebuild the container to apply these customizations.

Shutting Down the Container

After completing the task, you can shut down the container by closing the VS Code, which automatically stops the container. However, your project files and changes will persist on your local machine.

Additional Resources

To learn more about Runme, see more resources on Runme: