Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: introduce devcontainers #2282

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some intro for those who never used devcontainers in the patch comment would be helpful

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why it's good for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And how to build and use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added instructions and hopefully this patch will help developers simplify their development process

"name": "seastar-devcontainer",
"build": {
"dockerfile": "Dockerfile",
"context": "../"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/seastar,type=bind,consistency=default",
"workspaceFolder": "/workspaces/seastar",
"shutdownAction": "stopContainer"
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.devcontainer
.git
build
20 changes: 20 additions & 0 deletions doc/building-devcontainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Building seastar using devcontainers

A development container (or devcontainer for short) allows you to use a container as a full-featured development environment. It can be used to run an application, to separate tools, libraries, or runtimes needed for working with a codebase, and to aid in continuous integration and testing.

You can build a project with [devcontainers](https://containers.dev/) in an easy and convenient way.
Your IDE (e.g. Clion) or code editor (e.g. VS Code) can run and [attach](https://containers.dev/supporting) to devcontainer.

Also you can use [devcontainers/cli](https://github.com/devcontainers/cli) to set up environment and build the project manually via bash:

```bash
devcontainer up --workspace-folder .

devcontainer exec --workspace-folder . \
./configure.py --mode=release

devcontainer exec --workspace-folder . \
ninja -C build/release
```

It's just a more powerful and convenient version of [building-docker](./building-docker.md)