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

Simplify dev container and fix pre-commit repo #255

Open
wants to merge 2 commits into
base: main
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
43 changes: 0 additions & 43 deletions .devcontainer/Dockerfile

This file was deleted.

85 changes: 26 additions & 59 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Go",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Go: 1, 1.16, 1.15
"VARIANT": "1.18",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*"
}
},
"overrideCommand": false,
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/root/.ssh-copy,type=bind,consistency=cached"
],
// Use this environment variable if you need to bind mount your local source code into a new container.
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
"runArgs": [
"--init",
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"go.toolsManagement.checkForUpdates": "local",
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go",
"go.formatTool": "goimports",
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
],
"go.coverOnSave": true,
"go.coverageDecorator": {
"type": "gutter",
"coveredHighlightColor": "rgba(64,128,128,0.5)",
"uncoveredHighlightColor": "rgba(128,64,64,0.25)",
"coveredGutterStyle": "blockgreen",
"uncoveredGutterStyle": "blockred"
"name": "woke",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3-bullseye",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.18"
},
"go.coverOnSingleTest": true,
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true
"ghcr.io/guiyomh/features/golangci-lint:0": {},
"ghcr.io/lukewiwa/features/shellcheck:0": {}
},
// Add the IDs of extensions you want installed when the container is created.

// Extensions for use in VS Code
"extensions": [
"golang.Go", // Go Extension
"timonwong.shellcheck", // Shellcheck
"davidanson.vscode-markdownlint", // Markdownlint
"eamodio.gitlens", // IDE Git information
"ms-azuretools.vscode-docker" // Docker
"golang.go",
"timonwong.shellcheck",
"davidanson.vscode-markdownlint",
"eamodio.gitlens"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "mkdir -p /root/.ssh && cp -r /root/.ssh-copy/* /root/.ssh && chmod 700 /root/.ssh && chmod 600 /root/.ssh/id_rsa && chmod 644 /root/.ssh/id_rsa.pub && pre-commit install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
"postCreateCommand": "./.devcontainer/scripts/install_go_dev_tools.sh && pip3 install pre-commit && pre-commit install"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Loading