|
1 | 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the |
2 | 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/go |
3 | 3 | { |
4 | | - "name": "Go", |
5 | | - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile |
6 | | - "image": "mcr.microsoft.com/devcontainers/go:dev-1-bullseye", |
7 | | - // Features to add to the dev container. More info: https://containers.dev/features. |
8 | | - // "features": {}, |
9 | | - // Use 'forwardPorts' to make a list of ports inside the container available locally. |
10 | | - "forwardPorts": [ |
11 | | - 8181 |
12 | | - ], |
13 | | - // Use 'postCreateCommand' to run commands after the container is created. |
14 | | - "postCreateCommand": "go install github.com/air-verse/air@v1.62.0" |
15 | | - // Configure tool-specific properties. |
16 | | - // "customizations": {}, |
17 | | - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. |
18 | | - // "remoteUser": "root" |
| 4 | + "name": "Console Go", |
| 5 | + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile |
| 6 | + "build": { |
| 7 | + "dockerfile": "Dockerfile", |
| 8 | + "context": "..", |
| 9 | + "args": { |
| 10 | + "HTTP_PROXY": "${localEnv:HTTP_PROXY:}", |
| 11 | + "HTTPS_PROXY": "${localEnv:HTTPS_PROXY:}", |
| 12 | + "NO_PROXY": "${localEnv:NO_PROXY:}", |
| 13 | + "http_proxy": "${localEnv:http_proxy:}", |
| 14 | + "https_proxy": "${localEnv:https_proxy:}", |
| 15 | + "no_proxy": "${localEnv:no_proxy:}" |
| 16 | + } |
| 17 | + }, |
| 18 | + // Features to add to the dev container. More info: https://containers.dev/features. |
| 19 | + // "features": {}, |
| 20 | + // Use 'forwardPorts' to make a list of ports inside the container available locally. |
| 21 | + "forwardPorts": [ |
| 22 | + 8181 |
| 23 | + ], |
| 24 | + "features": { |
| 25 | + "ghcr.io/devcontainers/features/docker-in-docker:2": { |
| 26 | + "version": "latest", |
| 27 | + "moby": true |
| 28 | + }, |
| 29 | + "ghcr.io/devcontainers/features/node:1": { |
| 30 | + "version": "lts" |
| 31 | + }, |
| 32 | + "ghcr.io/devcontainers/features/common-utils:2": { |
| 33 | + "installZsh": true, |
| 34 | + "configureZshAsDefaultShell": true, |
| 35 | + "installOhMyZsh": true, |
| 36 | + "upgradePackages": true |
| 37 | + } |
| 38 | + }, |
| 39 | + "containerEnv": { |
| 40 | + "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}", |
| 41 | + "HTTP_PROXY": "${localEnv:HTTP_PROXY:}", |
| 42 | + "HTTPS_PROXY": "${localEnv:HTTPS_PROXY:}", |
| 43 | + "NO_PROXY": "${localEnv:NO_PROXY:}", |
| 44 | + "http_proxy": "${localEnv:http_proxy:}", |
| 45 | + "https_proxy": "${localEnv:https_proxy:}", |
| 46 | + "no_proxy": "${localEnv:no_proxy:}" |
| 47 | + }, |
| 48 | + // Use 'postCreateCommand' to run commands after the container is created. |
| 49 | + "postCreateCommand": "sed -i 's/\\r$//' .devcontainer/post-create.sh && /bin/bash .devcontainer/post-create.sh" |
| 50 | + |
| 51 | + // Configure tool-specific properties. |
| 52 | + // "customizations": {}, |
| 53 | + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. |
| 54 | + // "remoteUser": "root" |
19 | 55 | } |
0 commit comments