This repository provides a Dockerfile to build a fully functional Bosque Development Environment. You can either use prebuilt Docker images or build your own image locally.
Prebuilt Docker images are available here.
Pull the image directly using Docker:
docker pull brakmic/bosquedev:latestTo build the Docker image yourself:
-
Clone this repository.
-
Build the Docker image using the following command:
docker build -t your_user_prefix/bosquedev:latest .The build process will automatically clone the BosqueCore repository during the build stage, so no additional manual steps are required.
Run the container interactively with a mounted volume to persist your session.
docker run --rm -it -v $(pwd):/session your_user_prefix/bosquedev:latest-
PowerShell:
docker run --rm -it -v ${PWD}:/session your_user_prefix/bosquedev:latest
-
Command Prompt (CMD):
docker run --rm -it -v %cd%:/session your_user_prefix/bosquedev:latest -
Git Bash or WSL:
docker run --rm -it -v $(pwd):/session your_user_prefix/bosquedev:latest
You can use the provided Dockerfile as a development container in VS Code to streamline development.
A devcontainer is a containerized development environment that allows you to work in a consistent and isolated environment directly from your code editor.
-
Install Required Extensions:
- Install the Dev Containers extension in VS Code.
-
Open the Devcontainer Options:
- On macOS:
- Open VS Code.
- Click on the View menu > Command Palette or press
Cmd+Shift+P.
- On Windows:
- Open VS Code.
- Click on the View menu > Command Palette or press
Ctrl+Shift+P.
- In the Command Palette, search for and select
Dev Containers: Open Folder in Container....
- On macOS:
-
Select the Dockerfile:
- After selecting the folder containing your project, VS Code will prompt you to configure the devcontainer.
- If prompted, select
From 'Dockerfile'.
-
Configure the DevContainer (Optional):
-
Ensure there is a
.devcontainerfolder in the root of your project with adevcontainer.jsonfile. If it does not exist, create it with the following content:{ "name": "Bosque DevContainer", "build": { "dockerfile": "../Dockerfile" }, "workspaceFolder": "/workspace", "workspaceMount": "source=${localWorkspaceFolder},target=/host_workspace,type=bind,consistency=cached", "customizations": { "vscode": { "settings": { "files.exclude": { "**/.git": true, "**/.DS_Store": true } } } }, "mounts": [ "source=${localWorkspaceFolder}/scripts/setup-workspace.mjs,target=/workspace/scripts/setup-workspace.mjs,type=bind" ], "postCreateCommand": "node /workspace/scripts/setup-workspace.mjs && ln -sf /workspace/dev.code-workspace /home/bosquedev/.vscode-server/dev.code-workspace", "remoteUser": "bosquedev" }
-
-
Build and Open the DevContainer:
- VS Code will automatically build the devcontainer and open it.
- Once the build process is complete, the containerized development environment will be ready.
- Run
bosquein the integrated terminal to ensure the command is globally available. - Verify that the
/host_workspacefolder contains your project files.
In addition to the standard devcontainer setup, you have the option to create and use a VS Code workspace that includes both the devcontainer's /workspace directory and the mounted /host_workspace directory. This allows you to access and work on files from both the container and your local machine within the same workspace.
- Unified View: Work on your project files and container-specific files simultaneously.
- Ease of Access: Navigate seamlessly between local and container environments without switching contexts.
- Enhanced Productivity: Streamline your development workflow by having all necessary files in one place.
-
Ensure DevContainer is Running:
- Follow the steps in the Setting Up the DevContainer section to build and open the devcontainer.
-
Create the Workspace File:
- The devcontainer setup includes a script (
setup-workspace.mjs) that generates a workspace file nameddev.code-workspacecontaining both/workspaceand/host_workspace. - This workspace file is typically located in the
/workspacedirectory inside the container.
- The devcontainer setup includes a script (
-
Open the Workspace in VS Code:
-
Manual Method:
- After the devcontainer has been built and is running, locate the
dev.code-workspacefile within the container's/workspacedirectory. - In VS Code, go to File > Open Workspace... and navigate to the
dev.code-workspacefile to open it. - Alternatively, if the workspace file is accessible from your host machine (e.g., through a mounted volume), you can double-click the
dev.code-workspacefile in your file explorer to open it directly in VS Code.
- After the devcontainer has been built and is running, locate the
-
Using Symbolic Link:
- The
postCreateCommandindevcontainer.jsoncreates a symbolic link to the workspace file at/home/bosquedev/.vscode-server/dev.code-workspace. - In VS Code, you can open this workspace by navigating to File > Open Workspace... and selecting the linked
dev.code-workspacefile.
- The
-
-
Verify Workspace Contents:
- Once opened, the workspace should display both the
/workspaceand/host_workspacefolders in the VS Code Explorer pane. - You can now work on files from both directories seamlessly.
- Once opened, the workspace should display both the
- Manual Activation: Currently, the workspace file needs to be opened manually by double-clicking it in VS Code. This ensures that you have full control over when and how the workspace is activated.
- Consistency: Ensure that the workspace file is kept up-to-date if you make changes to the devcontainer configuration or project structure.
- Fully Functional Environment: Includes all dependencies to develop and run Bosque applications.
- Global
bosqueCommand: Thebosquecommand is globally available, enabling straightforward execution of Bosque scripts. - Interactive Development: Easily test and debug Bosque programs interactively using the container.
Contributions are welcome! Feel free to submit issues or pull requests to improve this repository.
This project is licensed under the MIT License.




