Multi-arch (linux/amd64
, linux/arm64/v8
) Mojo dev container.
🔥 All prerequisites
installed for Mojo standard library development.
Parent image: glcr.b-data.ch/mojo/base:nightly
Features
- Git: A distributed version-control system for tracking changes in source code.
- Git LFS: A Git extension for versioning large files.
- LLVM (optional, installed): A collection of modular and reusable compiler and toolchain technologies.
- Mojo (nightly): A programming language for AI developers.
- Pandoc: A universal markup converter.
- Python: An interpreted, object-oriented, high-level programming language with dynamic semantics.
- Zsh: A shell designed for interactive use, although it is also a powerful scripting language.
ℹ️ Regading Magic, see issue #2.
Pre-installed extensions
- Black Formatter
- Docker
- EditorConfig for VS Code
- Git Graph
- GitHub Actions
- GitHub Pull Requests and Issues
- GitLens — Git supercharged
ℹ️ Pinned to version 11.7.0 due to unsolicited AI content - hadolint
- Jupyter
- markdownlint
- Mojo 🔥 (nightly)
- Python
- Resource Monitor
- ShellCheck
- YAML
A fork of the Mojo repository:
- Owner: Your GitHub username
- Repository name: mojo
- Untick "Copy the
main
branch only"
Local: Dev containers require VS Code and either Docker or Podman to be installed.
Web: Codespaces require no installation.
Set up Visual Studio Code and install the Remote Development Extension Pack.
See Install Docker Engine | Docker Docs.
- Docker CE: Post-installation steps for Linux
See Podman Installation | Podman.
The Mojo dev container is not intended for work on this repository, but rather for Mojo standard library development and behaves in a unique way:
- Default mount:
- source: empty directory
- target:
/home/vscode
- type: volume
- Codespace only mount:
- source: root of this repository
- target:
/workspaces
- type: misc
- Default path:
/home/vscode/projects/modularml/mojo
- Repository: https://github.com/modularml/mojo.git
- Branch: nightly
- Default user:
vscode
- uid: 1000 (auto-assigned)
- gid: 1000 (auto-assigned)
- Lifecycle scripts:
onCreateCommand
: home directory setuppostStartCommand
: Codespace only: Silently remove all unused images and all build cachepostAttachCommand
: Codespace only: Check for dev container updates
To disable the postStartCommand
or postAttachCommand
, comment out line 8 in
~/.local/bin/dockerSystemPrune.sh
or ~/.local/bin/checkForUpdates.sh
.
- Click the
<> Code
button, then click the Codespaces tab.
A message is displayed at the bottom of the dialog telling you who will pay for the codespace. - Create your codespace after configuring advanced options:
- Configure advanced options
To configure advanced options for your codespace, such as a different machine type or a particulardevcontainer.json
file:- At the top right of the Codespaces tab, select
...
and click New with options.... - On the options page for your codespace, choose your preferred options from the dropdown menus.
- Click Create codespace.
- At the top right of the Codespaces tab, select
- Configure advanced options
– Creating a codespace for a repository - GitHub Docs
Set OWN_REPOSITORY_URL
in devcontainer.json.
Use the Dev Containers: Reopen in Container command from the Command Palette
(F1
, ⇧⌘P
(Windows, Linux Ctrl+Shift+P
))
ℹ️ For further information, see Developing inside a Container using Visual Studio Code Remote Development.
Data in the following locations is persisted:
- The user's home directory (
/home/vscode
)1 - The dev container's workspace (
/workspaces
)
This is accomplished via a volume (or loop device on Codespaces) and is preconfigured.
Codespaces: A 'Full Rebuild Container' resets the home directory! ℹ️ This is never necessary unless you want exactly that. |
---|
What makes this project different:
- Multi-arch:
linux/amd64
,linux/arm64/v8
ℹ️ Runs on Apple M series using Docker Desktop. - Base image: Debian instead of Ubuntu
- Just Python – no Conda / Mamba
PRs accepted.
This project follows the Contributor Covenant Code of Conduct.
Copyright © 2024 Olivier Benz
Distributed under the terms of the MIT License.
Footnotes
-
Alternatively for the root user (
/root
). Use with Docker/Podman in rootless mode. ↩