Sign inSign up

ifooth/devcontainer

By ifooth

•Updated 28 days ago

Full stack remote development environment

Image
2

50K+

ifooth/devcontainer repository overview

⁠DevContainer

Full stack remote development environment

Docker Docker Pulls

Base on vscode-dev-containers⁠ image

⁠Shell

⁠Vim

Plugin

⁠Python

usage

# switch python version
pyenv versions
export PYENV_VERSION=3.10

# use virtualenv, use the linked major version
mkvirtualenv -p /opt/pyenv/versions/3.10/bin/python hello-world
workon hello-world

.envrc

layout virtualenvwrapper hello-world
unset PS1

.vscode/settings.json

{
    "python.defaultInterpreterPath": "/root/.virtualenvs/hello-world/bin/python"
}

⁠Golang

usage

# switch golang version
gvm list
gvm use go1.17

.envrc

layout gvm go1.17

.vscode/settings.json

{
    "go.goroot": "/opt/gvm/gos/go1.17",
    "go.gopath": "/opt/gvm/pkgsets/go1.17/global"
}

golang private mod settings

.vscode/settings.json

{
    "go.goroot": "/opt/gvm/gos/go1.15",
    "go.gopath": "/opt/gvm/pkgsets/go1.15/global",
    "go.toolsEnvVars": {
        "GOPROXY": "https://athens-proxy.townsy.io,direct",
        "GOPRIVATE": "",
        "GONOSUMDB": "townsy.private-github.com"
    },
    "terminal.integrated.env.linux": {
        "GOPROXY": "https://athens-proxy.townsy.io,direct",
        "GOPRIVATE": "",
        "GONOSUMDB": "townsy.private-github.com"
    }
}

⁠Utils

  • cloc⁠ - counts blank lines, comment lines, and physical lines of source code in many programming languages
  • restic⁠ - Fast, secure, efficient backup program
  • rclone⁠ - rsync for cloud storage
  • android-platform-tools⁠ - such as adb, fastboot, and systrace tools

⁠Settings

install-extension

{
    "remote.extensionKind": {
        "alefragnani.project-manager": [
            "workspace"
        ]
    },
    "remote.SSH.defaultExtensions": [
        "ms-python.python",
        "ms-python.vscode-pylance",
        "golang.go",
        "TabNine.tabnine-vscode",
        "alefragnani.project-manager"
    ]
}

vscode remote ssh settings

~/.vscode-server/data/Machine/settings.json

use the linked major version

{
    "go.goroot": "/opt/gvm/gos/go1.17",
    "go.gopath": "/opt/gvm/pkgsets/go1.17/global",
    "go.toolsEnvVars": {
        "GOBIN": "/opt/go/bin"
    },
    "python.linting.flake8Path": "/usr/local/bin/flake8",
    "python.linting.flake8Args": [
        "--max-line-length=119"
    ],
    "python.formatting.blackPath": "/usr/local/bin/black",
    "python.formatting.blackArgs": [
        "--line-length=119"
    ],
    "python.sortImports.path": "/usr/local/bin/isort",
    "python.sortImports.args": [
        "--line-length=119"
    ],
    "python.terminal.activateEnvironment": false,
    "git.ignoredRepositories": [
        "/opt/pyenv"
    ],
    "projectManager.groupList": true,
    "projectManager.git.maxDepthRecursion": 4,
    "projectManager.git.baseFolders": [
        "/data/repos"
    ]
}

⁠Tips and Tricks

⁠windows remote ssh cann't connection with zsh

error log:

zsh: bad math expression: operand expected at `*100000 + ...'

solution: enable useLocalServer

{
    "remote.SSH.useLocalServer": true
}

maybe have non-Windows SSH installed⁠ issue, just ignore

Tag summary

Content type

Image

Digest

sha256:8f238ff4c…

Size

1.2 GB

Last updated

28 days ago

docker pull ifooth/devcontainer