mirror of https://github.com/docker/cli.git
initial devcontainer config + updated docs for usage info
Signed-off-by: krissetto <chrisjpetito@gmail.com>
This commit is contained in:
parent
465208e056
commit
aed24489d9
|
@ -0,0 +1,41 @@
|
||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/go
|
||||||
|
{
|
||||||
|
"name": "cli - devcontainer",
|
||||||
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/go:1-1.21-bullseye",
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/common-utils:2": {
|
||||||
|
"installZsh": true,
|
||||||
|
"configureZshAsDefaultShell": true,
|
||||||
|
"installOhMyZsh": true,
|
||||||
|
"installOhMyZshConfig": true,
|
||||||
|
"upgradePackages": true,
|
||||||
|
"username": "devcontainer",
|
||||||
|
"userUid": "1001",
|
||||||
|
"userGid": "1001"
|
||||||
|
},
|
||||||
|
"ghcr.io/devcontainers/features/docker-in-docker:2": {
|
||||||
|
"moby": true,
|
||||||
|
"version": "latest",
|
||||||
|
"dockerDashComposeVersion": "v2"
|
||||||
|
},
|
||||||
|
"ghcr.io/devcontainers/features/git:1": {
|
||||||
|
"ppa": true,
|
||||||
|
"version": "latest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Use 'postStartCommand' to run commands after the container is started.
|
||||||
|
"postStartCommand": "cd /workspaces/cli/ && ln -sf vendor.mod go.mod && ln -sf vendor.sum go.sum && go mod tidy",
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
// Set *default* container specific settings.json values on container create.
|
||||||
|
"settings": {},
|
||||||
|
"extensions": [
|
||||||
|
"bierner.markdown-mermaid"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,3 +7,7 @@ updates:
|
||||||
labels:
|
labels:
|
||||||
- "area/testing"
|
- "area/testing"
|
||||||
- "status/2-code-review"
|
- "status/2-code-review"
|
||||||
|
- package-ecosystem: "devcontainers"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
|
|
@ -7,12 +7,38 @@ start participating.
|
||||||
|
|
||||||
## Topics
|
## Topics
|
||||||
|
|
||||||
|
* [Development environment](#development-environment)
|
||||||
* [Reporting Security Issues](#reporting-security-issues)
|
* [Reporting Security Issues](#reporting-security-issues)
|
||||||
* [Design and Cleanup Proposals](#design-and-cleanup-proposals)
|
* [Design and Cleanup Proposals](#design-and-cleanup-proposals)
|
||||||
* [Reporting Issues](#reporting-other-issues)
|
* [Reporting Issues](#reporting-other-issues)
|
||||||
* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)
|
* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines)
|
||||||
* [Community Guidelines](#docker-community-guidelines)
|
* [Community Guidelines](#docker-community-guidelines)
|
||||||
|
|
||||||
|
## Development environment
|
||||||
|
|
||||||
|
The only requirements for setting up a local development environment are:
|
||||||
|
|
||||||
|
- [`go`](https://go.dev/dl/) -> latest version is fine, we use `//go:build go1.xx` directives in individual files to build those using a specific version of the go language/compiler;
|
||||||
|
- [`docker`](https://www.docker.com) -> latest version is also fine;
|
||||||
|
- `make` (on MacOS, install the developer command line tools with `xcode-select --install`)
|
||||||
|
- IDE of your choice ([`VSCode`](https://code.visualstudio.com/download), [`Jetbrains GoLand`](https://www.jetbrains.com/go/), etc.)
|
||||||
|
|
||||||
|
### Go modules
|
||||||
|
|
||||||
|
Currently the project is not setup as a standard "go modules" project to avoid breaking dependant projects. To develop the project as if it were a go module project, you should symlink the `vendor.mod/sum` files to `go.mod/sum`, the following command should do the trick:
|
||||||
|
|
||||||
|
`ln -s vendor.mod go.mod && ln -s vendor.sum go.sum`
|
||||||
|
|
||||||
|
This step is unnecessary if using the devcontainers approach seen below, as it's already configured to create the symlinks for development.
|
||||||
|
|
||||||
|
### Using a devcontainer
|
||||||
|
|
||||||
|
This project also comes with an included `.devcontainer/` directory and a `devcontainer.json` file that can be used with `VSCode` or `GoLand` to quickly setup a development container, with all the basic required development dependencies already included.
|
||||||
|
|
||||||
|
Using VSCode, all that's required is installing the [`Dev Containers` extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containersCheck), and it should auto-detect the `devcontainer.json` file and give you the option to start the container.
|
||||||
|
|
||||||
|
For other IDEs, please check the relevant documentation of your editor for instructions on how to use devcontainers
|
||||||
|
|
||||||
## Reporting security issues
|
## Reporting security issues
|
||||||
|
|
||||||
The Docker maintainers take security seriously. If you discover a security
|
The Docker maintainers take security seriously. If you discover a security
|
||||||
|
|
12
README.md
12
README.md
|
@ -12,7 +12,11 @@ This repository is the home of the Docker CLI.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
`docker/cli` is developed using Docker.
|
`docker/cli` is developed using Docker.
|
||||||
|
|
||||||
|
See the [`CONTRIBUTING.md`](./CONTRIBUTING.md) doc for more information on seting up a development environment.
|
||||||
|
|
||||||
|
### Some useful commands
|
||||||
|
|
||||||
Build CLI from source:
|
Build CLI from source:
|
||||||
|
|
||||||
|
@ -58,7 +62,11 @@ make help
|
||||||
|
|
||||||
### In-container development environment
|
### In-container development environment
|
||||||
|
|
||||||
Start an interactive development environment:
|
#### Using a `devcontainer`.
|
||||||
|
|
||||||
|
See [using a devcontainer](./CONTRIBUTING.md#using-a-devcontainer) for more details
|
||||||
|
|
||||||
|
#### Start an interactive development environment shell:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
make -f docker.Makefile shell
|
make -f docker.Makefile shell
|
||||||
|
|
Loading…
Reference in New Issue