-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve devcontainer to remove image build
- Loading branch information
Showing
12 changed files
with
175 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,86 @@ | ||
{ | ||
"build": { | ||
"args": { | ||
"VARIANT": "ubuntu-22.04" | ||
}, | ||
"dockerfile": "Dockerfile" | ||
"containerEnv": { | ||
"AWS_DEFAULT_REGION": "${localEnv:AWS_DEFAULT_REGION:us-east-1}", | ||
"AWS_MAX_ATTEMPTS": "20", | ||
"AWS_RETRY_MODE": "adaptive", | ||
"CFNGIN_STACK_POLL_TIME": "3", | ||
"TZ": "${localEnv:TZ:US/Eastern}" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python" | ||
] | ||
"Compulim.vscode-clock", | ||
"DavidAnson.vscode-markdownlint", | ||
"PeterSchmalfeldt.explorer-exclude", | ||
"SirTori.indenticator", | ||
"Tyriar.sort-lines", | ||
"VisualStudioExptTeam.vscodeintellicode", | ||
"bierner.markdown-checkbox", | ||
"charliermarsh.ruff", | ||
"christian-kohler.path-intellisense", | ||
"donjayamanne.githistory", | ||
"eamodio.gitlens", | ||
"editorconfig.editorconfig", | ||
"github.vscode-github-actions", | ||
"hashicorp.terraform", | ||
"lextudio.restructuredtext", | ||
"mohsen1.prettify-json", | ||
"ms-python.black-formatter", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"oderwat.indent-rainbow", | ||
"redhat.vscode-yaml", | ||
"remcohaszing.schemastore", | ||
"richie5um2.vscode-sort-json", | ||
"streetsidesoftware.code-spell-checker", | ||
"tamasfe.even-better-toml", | ||
"trond-snekvik.simple-rst", | ||
"yzhang.markdown-all-in-one" | ||
], | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"icon": "terminal-bash", | ||
"path": "bash" | ||
}, | ||
"zsh": { | ||
"path": "zsh" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {} | ||
"./local-features/poetry": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/node:1": {} | ||
}, | ||
"name": "Ubuntu", | ||
"remoteUser": "vscode" | ||
"image": "mcr.microsoft.com/devcontainers/python:3.12", | ||
"mounts": [ | ||
{ | ||
"source": "${localEnv:HOME}/.aws", | ||
"target": "/home/vscode/.aws", | ||
"type": "bind" | ||
}, | ||
{ | ||
"source": "devcontainer-${containerWorkspaceFolderBasename}-node_modules", | ||
"target": "${containerWorkspaceFolder}/node_modules", | ||
"type": "volume" | ||
}, | ||
{ | ||
"source": "devcontainer-npm-cache", | ||
"target": "/home/vscode/.npm", | ||
"type": "volume" | ||
}, | ||
{ | ||
"source": "devcontainer-${containerWorkspaceFolderBasename}-pre-commit-cache", | ||
"target": "/home/vscode/.cache/pre-commit", | ||
"type": "volume" | ||
} | ||
], | ||
"name": "devcontainer-runway", | ||
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}; sudo apt-get update -y; sudo apt-get install direnv", | ||
"postAttachCommand": "make setup", | ||
"postStartCommand": "sudo chown -R vscode:vscode .venv node_modules ~/.cache/pre-commit ~/.npm ~/.cache/pip ~/.cache/pypoetry" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# local-feature | ||
|
||
A collection of local devcontainer features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# poetry | ||
|
||
Install `poetry` using `pipx` included on the image. | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"./local-features/poetry": {} | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
.devcontainer/local-features/poetry/devcontainer-feature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"description": "Install `poetry` using `pipx` included in the image.", | ||
"documentationURL": "", | ||
"id": "poetry", | ||
"installsAfter": [], | ||
"mounts": [ | ||
{ | ||
"source": "devcontainer-pip-cache", | ||
"target": "/home/vscode/.cache/pip", | ||
"type": "volume" | ||
}, | ||
{ | ||
"source": "devcontainer-poetry-cache", | ||
"target": "/home/vscode/.cache/pypoetry", | ||
"type": "volume" | ||
}, | ||
{ | ||
"source": "devcontainer-${containerWorkspaceFolderBasename}-venv", | ||
"target": "${containerWorkspaceFolder}/.venv", | ||
"type": "volume" | ||
} | ||
], | ||
"name": "poetry", | ||
"options": {}, | ||
"version": "0.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
function __install_poetry { | ||
if [[ -z "$(command -v poetry)" ]]; then | ||
pipx install poetry; | ||
pipx inject poetry "poetry-dynamic-versioning[plugin]" poetry-plugin-export; | ||
fi | ||
} | ||
|
||
function __configure_poetry { | ||
poetry config virtualenvs.create true; | ||
poetry config virtualenvs.in-project true; | ||
poetry config virtualenvs.prefer-active-python true; | ||
poetry config warnings.export false; | ||
} | ||
|
||
__install_poetry; | ||
__configure_poetry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"recommendations": [ | ||
"DavidAnson.vscode-markdownlint", | ||
"charliermarsh.ruff", | ||
"editorconfig.editorconfig", | ||
"lextudio.restructuredtext", | ||
"ms-python.black-formatter", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance" | ||
"ms-python.vscode-pylance", | ||
"redhat.vscode-yaml", | ||
"streetsidesoftware.code-spell-checker", | ||
"tamasfe.even-better-toml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.