@enjoys/context-engine 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/commands/adb.json +322 -0
- package/data/commands/alembic.json +301 -0
- package/data/commands/artisan.json +277 -0
- package/data/commands/atlas.json +426 -0
- package/data/commands/auth0.json +648 -0
- package/data/commands/bat.json +84 -0
- package/data/commands/btop.json +59 -0
- package/data/commands/bundle.json +321 -0
- package/data/commands/composer.json +507 -0
- package/data/commands/dart.json +216 -0
- package/data/commands/dbmate.json +257 -0
- package/data/commands/docker-compose.json +384 -0
- package/data/commands/drizzle-kit.json +217 -0
- package/data/commands/expo.json +65 -0
- package/data/commands/fastlane.json +243 -0
- package/data/commands/fd.json +86 -0
- package/data/commands/flutter.json +298 -0
- package/data/commands/flyway.json +261 -0
- package/data/commands/fzf.json +103 -0
- package/data/commands/gem.json +267 -0
- package/data/commands/htop.json +56 -0
- package/data/commands/jq.json +100 -0
- package/data/commands/k9s.json +62 -0
- package/data/commands/linux.json +3007 -0
- package/data/commands/liquibase.json +399 -0
- package/data/commands/manifest.json +619 -0
- package/data/commands/minikube.json +60 -0
- package/data/commands/ng.json +64 -0
- package/data/commands/nuxt.json +60 -0
- package/data/commands/nvim.json +91 -0
- package/data/commands/php.json +157 -0
- package/data/commands/pm2.json +259 -0
- package/data/commands/pod.json +175 -0
- package/data/commands/prisma.json +257 -0
- package/data/commands/rails.json +372 -0
- package/data/commands/rake.json +360 -0
- package/data/commands/react-native.json +57 -0
- package/data/commands/rg.json +103 -0
- package/data/commands/rspec.json +257 -0
- package/data/commands/ruby.json +108 -0
- package/data/commands/screen.json +101 -0
- package/data/commands/sequelize.json +342 -0
- package/data/commands/snyk.json +442 -0
- package/data/commands/sonar-scanner.json +219 -0
- package/data/commands/stripe.json +314 -0
- package/data/commands/symfony.json +449 -0
- package/data/commands/tmux.json +197 -0
- package/data/commands/top.json +61 -0
- package/data/commands/trivy.json +367 -0
- package/data/commands/twilio.json +382 -0
- package/data/commands/typeorm.json +262 -0
- package/data/commands/vim.json +85 -0
- package/data/commands/vue.json +60 -0
- package/data/commands/wp.json +857 -0
- package/data/commands/xcodebuild.json +141 -0
- package/data/commands/yq.json +57 -0
- package/data/completion/bash.json +1184 -0
- package/data/completion/c.json +1067 -0
- package/data/completion/cpp.json +824 -0
- package/data/completion/csharp.json +860 -0
- package/data/completion/dockerfile.json +536 -0
- package/data/completion/go.json +1346 -0
- package/data/completion/html.json +806 -0
- package/data/completion/java.json +1112 -0
- package/data/completion/javascript.json +914 -0
- package/data/completion/lua.json +968 -0
- package/data/completion/php.json +1535 -0
- package/data/completion/python.json +1427 -0
- package/data/completion/ruby.json +1531 -0
- package/data/completion/rust.json +698 -0
- package/data/completion/sql.json +887 -0
- package/data/completion/toml.json +428 -0
- package/data/completion/typescript.json +338 -0
- package/data/completion/yaml.json +563 -0
- package/data/defination/bash.json +565 -0
- package/data/defination/c.json +865 -0
- package/data/defination/cpp.json +348 -0
- package/data/defination/csharp.json +144 -0
- package/data/defination/dockerfile.json +113 -0
- package/data/defination/go.json +561 -0
- package/data/defination/html.json +559 -0
- package/data/defination/java.json +184 -0
- package/data/defination/javascript.json +265 -0
- package/data/defination/lua.json +181 -0
- package/data/defination/php.json +726 -0
- package/data/defination/python.json +717 -0
- package/data/defination/ruby.json +670 -0
- package/data/defination/rust.json +207 -0
- package/data/defination/sql.json +473 -0
- package/data/defination/toml.json +251 -0
- package/data/defination/typescript.json +29 -0
- package/data/defination/yaml.json +197 -0
- package/data/hover/bash.json +245 -0
- package/data/hover/c.json +265 -0
- package/data/hover/cpp.json +210 -0
- package/data/hover/csharp.json +290 -0
- package/data/hover/dockerfile.json +145 -0
- package/data/hover/go.json +580 -0
- package/data/hover/html.json +250 -0
- package/data/hover/java.json +395 -0
- package/data/hover/javascript.json +330 -0
- package/data/hover/lua.json +265 -0
- package/data/hover/php.json +300 -0
- package/data/hover/python.json +380 -0
- package/data/hover/ruby.json +265 -0
- package/data/hover/rust.json +275 -0
- package/data/hover/sql.json +230 -0
- package/data/hover/toml.json +145 -0
- package/data/hover/typescript.json +120 -0
- package/data/hover/yaml.json +165 -0
- package/data/manifest.json +242 -0
- package/package.json +1 -1
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "dockerfile",
|
|
3
|
+
"completions": [
|
|
4
|
+
{
|
|
5
|
+
"label": "FROM",
|
|
6
|
+
"kind": 14,
|
|
7
|
+
"detail": "Set the base image",
|
|
8
|
+
"documentation": { "value": "Initialize a new build stage and set the base image.\n\n```dockerfile\nFROM ubuntu:22.04\nFROM node:20-alpine\nFROM --platform=linux/amd64 golang:1.21\n```" },
|
|
9
|
+
"insertText": "FROM ${1:image}:${2:tag}",
|
|
10
|
+
"insertTextRules": 4,
|
|
11
|
+
"sortText": "00_FROM"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "FROM ... AS (multi-stage)",
|
|
15
|
+
"kind": 15,
|
|
16
|
+
"detail": "Multi-stage build base image",
|
|
17
|
+
"documentation": { "value": "Set a base image with a named build stage for multi-stage builds.\n\n```dockerfile\nFROM node:20-alpine AS builder\nRUN npm ci && npm run build\n\nFROM nginx:alpine AS production\nCOPY --from=builder /app/dist /usr/share/nginx/html\n```" },
|
|
18
|
+
"insertText": "FROM ${1:image}:${2:tag} AS ${3:stage_name}",
|
|
19
|
+
"insertTextRules": 4,
|
|
20
|
+
"sortText": "00_FROM_AS"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "FROM scratch",
|
|
24
|
+
"kind": 15,
|
|
25
|
+
"detail": "Start from an empty image",
|
|
26
|
+
"documentation": { "value": "Use an empty base image. Commonly used for statically compiled binaries (Go, Rust).\n\n```dockerfile\nFROM scratch\nCOPY --from=builder /app/mybin /mybin\nENTRYPOINT [\"/mybin\"]\n```" },
|
|
27
|
+
"insertText": "FROM scratch",
|
|
28
|
+
"insertTextRules": 4,
|
|
29
|
+
"sortText": "00_FROM_scratch"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "FROM --platform",
|
|
33
|
+
"kind": 15,
|
|
34
|
+
"detail": "Set base image with platform",
|
|
35
|
+
"documentation": { "value": "Specify the target platform for the build stage.\n\n```dockerfile\nFROM --platform=linux/amd64 ubuntu:22.04\nFROM --platform=$BUILDPLATFORM golang:1.21 AS builder\n```" },
|
|
36
|
+
"insertText": "FROM --platform=${1|linux/amd64,linux/arm64,$BUILDPLATFORM,$TARGETPLATFORM|} ${2:image}:${3:tag}",
|
|
37
|
+
"insertTextRules": 4,
|
|
38
|
+
"sortText": "00_FROM_platform"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "RUN",
|
|
42
|
+
"kind": 14,
|
|
43
|
+
"detail": "Execute a command in the build",
|
|
44
|
+
"documentation": { "value": "Execute a command in a new layer on top of the current image.\n\n```dockerfile\nRUN apt-get update && apt-get install -y curl\nRUN pip install --no-cache-dir -r requirements.txt\n```" },
|
|
45
|
+
"insertText": "RUN ${1:command}",
|
|
46
|
+
"insertTextRules": 4,
|
|
47
|
+
"sortText": "01_RUN"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "RUN (exec form)",
|
|
51
|
+
"kind": 15,
|
|
52
|
+
"detail": "Execute a command in exec form",
|
|
53
|
+
"documentation": { "value": "Execute a command using the exec form (JSON array). This avoids shell processing and is preferred when you don't need shell features.\n\n```dockerfile\nRUN [\"executable\", \"param1\", \"param2\"]\nRUN [\"apt-get\", \"install\", \"-y\", \"curl\"]\n```" },
|
|
54
|
+
"insertText": "RUN [\"${1:executable}\", \"${2:param1}\"]",
|
|
55
|
+
"insertTextRules": 4,
|
|
56
|
+
"sortText": "01_RUN_exec"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"label": "RUN --mount=type=cache",
|
|
60
|
+
"kind": 15,
|
|
61
|
+
"detail": "RUN with cache mount",
|
|
62
|
+
"documentation": { "value": "Mount a cache directory that persists across builds. Speeds up package manager installs.\n\n```dockerfile\nRUN --mount=type=cache,target=/var/cache/apt \\\n apt-get update && apt-get install -y curl\n\nRUN --mount=type=cache,target=/root/.cache/pip \\\n pip install -r requirements.txt\n```" },
|
|
63
|
+
"insertText": "RUN --mount=type=cache,target=${1:/var/cache/apt} \\\n ${2:command}",
|
|
64
|
+
"insertTextRules": 4,
|
|
65
|
+
"sortText": "01_RUN_cache"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "RUN --mount=type=secret",
|
|
69
|
+
"kind": 15,
|
|
70
|
+
"detail": "RUN with secret mount",
|
|
71
|
+
"documentation": { "value": "Mount a secret file that won't be stored in the final image.\n\n```dockerfile\nRUN --mount=type=secret,id=mysecret,target=/run/secrets/mysecret \\\n cat /run/secrets/mysecret\n\n# Build: docker build --secret id=mysecret,src=secret.txt .\n```" },
|
|
72
|
+
"insertText": "RUN --mount=type=secret,id=${1:secret_id},target=${2:/run/secrets/$1} \\\n ${3:command}",
|
|
73
|
+
"insertTextRules": 4,
|
|
74
|
+
"sortText": "01_RUN_secret"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"label": "RUN --mount=type=ssh",
|
|
78
|
+
"kind": 15,
|
|
79
|
+
"detail": "RUN with SSH agent forwarding",
|
|
80
|
+
"documentation": { "value": "Mount the SSH agent socket for accessing private repositories.\n\n```dockerfile\nRUN --mount=type=ssh \\\n git clone git@github.com:private/repo.git\n\n# Build: docker build --ssh default .\n```" },
|
|
81
|
+
"insertText": "RUN --mount=type=ssh \\\n ${1:git clone git@github.com:user/repo.git}",
|
|
82
|
+
"insertTextRules": 4,
|
|
83
|
+
"sortText": "01_RUN_ssh"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"label": "CMD",
|
|
87
|
+
"kind": 14,
|
|
88
|
+
"detail": "Default command for the container",
|
|
89
|
+
"documentation": { "value": "Set the default command to run when the container starts. Only the last CMD takes effect.\n\n```dockerfile\nCMD [\"node\", \"server.js\"]\nCMD [\"python\", \"app.py\"]\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```" },
|
|
90
|
+
"insertText": "CMD [\"${1:executable}\", \"${2:param1}\"]",
|
|
91
|
+
"insertTextRules": 4,
|
|
92
|
+
"sortText": "02_CMD"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "LABEL",
|
|
96
|
+
"kind": 14,
|
|
97
|
+
"detail": "Add metadata to an image",
|
|
98
|
+
"documentation": { "value": "Add metadata as key-value pairs to an image.\n\n```dockerfile\nLABEL maintainer=\"user@example.com\"\nLABEL version=\"1.0\" description=\"My app\"\nLABEL org.opencontainers.image.source=\"https://github.com/user/repo\"\n```" },
|
|
99
|
+
"insertText": "LABEL ${1:key}=\"${2:value}\"",
|
|
100
|
+
"insertTextRules": 4,
|
|
101
|
+
"sortText": "03_LABEL"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"label": "MAINTAINER",
|
|
105
|
+
"kind": 14,
|
|
106
|
+
"detail": "Set the author (deprecated)",
|
|
107
|
+
"documentation": { "value": "**Deprecated.** Use `LABEL maintainer=\"...\"` instead.\n\n```dockerfile\n# Deprecated:\nMAINTAINER user@example.com\n\n# Preferred:\nLABEL maintainer=\"user@example.com\"\n```" },
|
|
108
|
+
"insertText": "MAINTAINER ${1:name}",
|
|
109
|
+
"insertTextRules": 4,
|
|
110
|
+
"sortText": "04_MAINTAINER"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"label": "EXPOSE",
|
|
114
|
+
"kind": 14,
|
|
115
|
+
"detail": "Declare container listen port",
|
|
116
|
+
"documentation": { "value": "Inform Docker the container listens on the specified port(s) at runtime. This is documentation only — you still need `-p` to publish.\n\n```dockerfile\nEXPOSE 80\nEXPOSE 443\nEXPOSE 3000/tcp 3001/udp\n```" },
|
|
117
|
+
"insertText": "EXPOSE ${1:port}",
|
|
118
|
+
"insertTextRules": 4,
|
|
119
|
+
"sortText": "05_EXPOSE"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"label": "ENV",
|
|
123
|
+
"kind": 14,
|
|
124
|
+
"detail": "Set environment variable",
|
|
125
|
+
"documentation": { "value": "Set an environment variable that persists in the running container.\n\n```dockerfile\nENV NODE_ENV=production\nENV APP_HOME=/app\nENV PATH=\"/app/bin:$PATH\"\n```" },
|
|
126
|
+
"insertText": "ENV ${1:KEY}=${2:value}",
|
|
127
|
+
"insertTextRules": 4,
|
|
128
|
+
"sortText": "06_ENV"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"label": "ADD",
|
|
132
|
+
"kind": 14,
|
|
133
|
+
"detail": "Add files to the image",
|
|
134
|
+
"documentation": { "value": "Copy files, directories, or remote URLs into the image. Supports auto-extraction of tar archives. Prefer COPY unless you need tar extraction or URLs.\n\n```dockerfile\nADD app.tar.gz /app/\nADD https://example.com/file.txt /data/\nADD --chown=1000:1000 files/ /app/\n```" },
|
|
135
|
+
"insertText": "ADD ${1:src} ${2:dest}",
|
|
136
|
+
"insertTextRules": 4,
|
|
137
|
+
"sortText": "07_ADD"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"label": "COPY",
|
|
141
|
+
"kind": 14,
|
|
142
|
+
"detail": "Copy files into the image",
|
|
143
|
+
"documentation": { "value": "Copy files or directories from the build context into the image.\n\n```dockerfile\nCOPY . /app/\nCOPY package.json package-lock.json ./\nCOPY --chown=node:node src/ /app/src/\n```" },
|
|
144
|
+
"insertText": "COPY ${1:src} ${2:dest}",
|
|
145
|
+
"insertTextRules": 4,
|
|
146
|
+
"sortText": "08_COPY"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"label": "COPY --from",
|
|
150
|
+
"kind": 15,
|
|
151
|
+
"detail": "Copy files from another build stage",
|
|
152
|
+
"documentation": { "value": "Copy files from a named build stage or external image.\n\n```dockerfile\nCOPY --from=builder /app/dist /usr/share/nginx/html\nCOPY --from=0 /app/bin /usr/local/bin/\nCOPY --from=alpine:latest /etc/alpine-release /\n```" },
|
|
153
|
+
"insertText": "COPY --from=${1:stage} ${2:src} ${3:dest}",
|
|
154
|
+
"insertTextRules": 4,
|
|
155
|
+
"sortText": "08_COPY_from"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"label": "COPY --chown",
|
|
159
|
+
"kind": 15,
|
|
160
|
+
"detail": "Copy files with ownership",
|
|
161
|
+
"documentation": { "value": "Copy files and set ownership in a single step.\n\n```dockerfile\nCOPY --chown=node:node . /app/\nCOPY --chown=1000:1000 config/ /etc/app/\n```" },
|
|
162
|
+
"insertText": "COPY --chown=${1:user}:${2:group} ${3:src} ${4:dest}",
|
|
163
|
+
"insertTextRules": 4,
|
|
164
|
+
"sortText": "08_COPY_chown"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"label": "ENTRYPOINT",
|
|
168
|
+
"kind": 14,
|
|
169
|
+
"detail": "Configure the container executable",
|
|
170
|
+
"documentation": { "value": "Set the main executable for the container. CMD arguments are appended to ENTRYPOINT.\n\n```dockerfile\nENTRYPOINT [\"docker-entrypoint.sh\"]\nENTRYPOINT [\"python\", \"-m\", \"flask\"]\nENTRYPOINT [\"java\", \"-jar\", \"app.jar\"]\n```" },
|
|
171
|
+
"insertText": "ENTRYPOINT [\"${1:executable}\"]",
|
|
172
|
+
"insertTextRules": 4,
|
|
173
|
+
"sortText": "09_ENTRYPOINT"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"label": "VOLUME",
|
|
177
|
+
"kind": 14,
|
|
178
|
+
"detail": "Create a mount point",
|
|
179
|
+
"documentation": { "value": "Create a mount point for externally mounted volumes or other containers.\n\n```dockerfile\nVOLUME /data\nVOLUME [\"/var/log\", \"/data\"]\n```" },
|
|
180
|
+
"insertText": "VOLUME ${1:/data}",
|
|
181
|
+
"insertTextRules": 4,
|
|
182
|
+
"sortText": "10_VOLUME"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"label": "USER",
|
|
186
|
+
"kind": 14,
|
|
187
|
+
"detail": "Set the user for subsequent instructions",
|
|
188
|
+
"documentation": { "value": "Set the user (and optionally group) for RUN, CMD, and ENTRYPOINT instructions that follow.\n\n```dockerfile\nRUN groupadd -r appuser && useradd -r -g appuser appuser\nUSER appuser\nUSER 1000:1000\n```" },
|
|
189
|
+
"insertText": "USER ${1:user}",
|
|
190
|
+
"insertTextRules": 4,
|
|
191
|
+
"sortText": "11_USER"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"label": "WORKDIR",
|
|
195
|
+
"kind": 14,
|
|
196
|
+
"detail": "Set the working directory",
|
|
197
|
+
"documentation": { "value": "Set the working directory for RUN, CMD, ENTRYPOINT, COPY, and ADD instructions that follow.\n\n```dockerfile\nWORKDIR /app\nWORKDIR /usr/src/app\n```" },
|
|
198
|
+
"insertText": "WORKDIR ${1:/app}",
|
|
199
|
+
"insertTextRules": 4,
|
|
200
|
+
"sortText": "12_WORKDIR"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"label": "ARG",
|
|
204
|
+
"kind": 14,
|
|
205
|
+
"detail": "Define a build-time variable",
|
|
206
|
+
"documentation": { "value": "Define a variable that users can pass at build time with `--build-arg`.\n\n```dockerfile\nARG NODE_VERSION=20\nARG APP_VERSION\nFROM node:${NODE_VERSION}-alpine\n```\n\nBuild: `docker build --build-arg NODE_VERSION=18 .`" },
|
|
207
|
+
"insertText": "ARG ${1:name}=${2:default}",
|
|
208
|
+
"insertTextRules": 4,
|
|
209
|
+
"sortText": "13_ARG"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"label": "ONBUILD",
|
|
213
|
+
"kind": 14,
|
|
214
|
+
"detail": "Add trigger instruction for downstream builds",
|
|
215
|
+
"documentation": { "value": "Add a trigger instruction that executes when the image is used as a base for another build.\n\n```dockerfile\nONBUILD COPY . /app/src\nONBUILD RUN npm install\n```" },
|
|
216
|
+
"insertText": "ONBUILD ${1:INSTRUCTION}",
|
|
217
|
+
"insertTextRules": 4,
|
|
218
|
+
"sortText": "14_ONBUILD"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"label": "STOPSIGNAL",
|
|
222
|
+
"kind": 14,
|
|
223
|
+
"detail": "Set the system call signal for stopping the container",
|
|
224
|
+
"documentation": { "value": "Set the signal that will be sent to the container to stop it.\n\n```dockerfile\nSTOPSIGNAL SIGTERM\nSTOPSIGNAL SIGQUIT\nSTOPSIGNAL 9\n```" },
|
|
225
|
+
"insertText": "STOPSIGNAL ${1|SIGTERM,SIGQUIT,SIGKILL,SIGINT|}",
|
|
226
|
+
"insertTextRules": 4,
|
|
227
|
+
"sortText": "15_STOPSIGNAL"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"label": "HEALTHCHECK",
|
|
231
|
+
"kind": 14,
|
|
232
|
+
"detail": "Define container health check",
|
|
233
|
+
"documentation": { "value": "Tell Docker how to test the container to check that it is still working.\n\n```dockerfile\nHEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \\\n CMD curl -f http://localhost:8080/health || exit 1\n\nHEALTHCHECK NONE\n```" },
|
|
234
|
+
"insertText": "HEALTHCHECK --interval=${1:30s} --timeout=${2:10s} --start-period=${3:5s} --retries=${4:3} \\\n CMD ${5:curl -f http://localhost:8080/health || exit 1}",
|
|
235
|
+
"insertTextRules": 4,
|
|
236
|
+
"sortText": "16_HEALTHCHECK"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"label": "SHELL",
|
|
240
|
+
"kind": 14,
|
|
241
|
+
"detail": "Override the default shell",
|
|
242
|
+
"documentation": { "value": "Override the default shell used for the shell form of commands.\n\n```dockerfile\nSHELL [\"/bin/bash\", \"-c\"]\nSHELL [\"powershell\", \"-command\"]\n```" },
|
|
243
|
+
"insertText": "SHELL [\"${1:/bin/bash}\", \"${2:-c}\"]",
|
|
244
|
+
"insertTextRules": 4,
|
|
245
|
+
"sortText": "17_SHELL"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"label": "FROM node",
|
|
249
|
+
"kind": 27,
|
|
250
|
+
"detail": "Node.js base image",
|
|
251
|
+
"documentation": { "value": "Use the official Node.js image as the base.\n\n```dockerfile\nFROM node:20-alpine\nFROM node:18-slim\nFROM node:20-bookworm\n```\n\nVariants: `alpine` (minimal ~50MB), `slim` (Debian minimal), `bookworm`/`bullseye` (full Debian)." },
|
|
252
|
+
"insertText": "FROM node:${1|20-alpine,20-slim,20-bookworm,18-alpine,18-slim,22-alpine|}",
|
|
253
|
+
"insertTextRules": 4,
|
|
254
|
+
"sortText": "20_node"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"label": "FROM python",
|
|
258
|
+
"kind": 27,
|
|
259
|
+
"detail": "Python base image",
|
|
260
|
+
"documentation": { "value": "Use the official Python image as the base.\n\n```dockerfile\nFROM python:3.12-slim\nFROM python:3.11-alpine\nFROM python:3.12-bookworm\n```\n\nVariants: `slim` (recommended for most apps), `alpine` (smallest), `bookworm` (full Debian)." },
|
|
261
|
+
"insertText": "FROM python:${1|3.12-slim,3.12-alpine,3.12-bookworm,3.11-slim,3.11-alpine|}",
|
|
262
|
+
"insertTextRules": 4,
|
|
263
|
+
"sortText": "20_python"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"label": "FROM golang",
|
|
267
|
+
"kind": 27,
|
|
268
|
+
"detail": "Go base image",
|
|
269
|
+
"documentation": { "value": "Use the official Go image as the base.\n\n```dockerfile\nFROM golang:1.22-alpine\nFROM golang:1.22-bookworm\n```\n\nGo binaries are statically linked by default — ideal for multi-stage builds with `FROM scratch`." },
|
|
270
|
+
"insertText": "FROM golang:${1|1.22-alpine,1.22-bookworm,1.21-alpine,1.21-bookworm|}",
|
|
271
|
+
"insertTextRules": 4,
|
|
272
|
+
"sortText": "20_golang"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"label": "FROM rust",
|
|
276
|
+
"kind": 27,
|
|
277
|
+
"detail": "Rust base image",
|
|
278
|
+
"documentation": { "value": "Use the official Rust image as the base.\n\n```dockerfile\nFROM rust:1.77-slim\nFROM rust:1.77-alpine\nFROM rust:1.77-bookworm\n```\n\nUse multi-stage builds to create minimal final images." },
|
|
279
|
+
"insertText": "FROM rust:${1|1.77-slim,1.77-alpine,1.77-bookworm|}",
|
|
280
|
+
"insertTextRules": 4,
|
|
281
|
+
"sortText": "20_rust"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"label": "FROM ubuntu",
|
|
285
|
+
"kind": 27,
|
|
286
|
+
"detail": "Ubuntu base image",
|
|
287
|
+
"documentation": { "value": "Use the official Ubuntu image as the base.\n\n```dockerfile\nFROM ubuntu:22.04\nFROM ubuntu:24.04\nFROM ubuntu:20.04\n```" },
|
|
288
|
+
"insertText": "FROM ubuntu:${1|24.04,22.04,20.04|}",
|
|
289
|
+
"insertTextRules": 4,
|
|
290
|
+
"sortText": "20_ubuntu"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"label": "FROM alpine",
|
|
294
|
+
"kind": 27,
|
|
295
|
+
"detail": "Alpine Linux base image",
|
|
296
|
+
"documentation": { "value": "Use Alpine Linux (~5MB) for minimal images.\n\n```dockerfile\nFROM alpine:3.19\nFROM alpine:3.18\n```\n\nUses `musl` libc and `apk` package manager. May have compatibility issues with some C libraries." },
|
|
297
|
+
"insertText": "FROM alpine:${1|3.19,3.18,3.17|}",
|
|
298
|
+
"insertTextRules": 4,
|
|
299
|
+
"sortText": "20_alpine"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"label": "FROM debian",
|
|
303
|
+
"kind": 27,
|
|
304
|
+
"detail": "Debian base image",
|
|
305
|
+
"documentation": { "value": "Use the official Debian image as the base.\n\n```dockerfile\nFROM debian:bookworm-slim\nFROM debian:bullseye-slim\n```\n\n`-slim` variants are much smaller and sufficient for most applications." },
|
|
306
|
+
"insertText": "FROM debian:${1|bookworm-slim,bullseye-slim,bookworm,bullseye|}",
|
|
307
|
+
"insertTextRules": 4,
|
|
308
|
+
"sortText": "20_debian"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"label": "FROM nginx",
|
|
312
|
+
"kind": 27,
|
|
313
|
+
"detail": "Nginx web server base image",
|
|
314
|
+
"documentation": { "value": "Use the official Nginx image.\n\n```dockerfile\nFROM nginx:alpine\nFROM nginx:1.25-alpine\n```\n\nDefault serves `/usr/share/nginx/html`. Config at `/etc/nginx/nginx.conf`." },
|
|
315
|
+
"insertText": "FROM nginx:${1|alpine,1.25-alpine,1.25-bookworm,stable-alpine|}",
|
|
316
|
+
"insertTextRules": 4,
|
|
317
|
+
"sortText": "20_nginx"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"label": "FROM redis",
|
|
321
|
+
"kind": 27,
|
|
322
|
+
"detail": "Redis base image",
|
|
323
|
+
"documentation": { "value": "Use the official Redis image.\n\n```dockerfile\nFROM redis:7-alpine\nFROM redis:7-bookworm\n```\n\nData directory: `/data`. Default port: 6379." },
|
|
324
|
+
"insertText": "FROM redis:${1|7-alpine,7-bookworm,6-alpine|}",
|
|
325
|
+
"insertTextRules": 4,
|
|
326
|
+
"sortText": "20_redis"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"label": "FROM postgres",
|
|
330
|
+
"kind": 27,
|
|
331
|
+
"detail": "PostgreSQL base image",
|
|
332
|
+
"documentation": { "value": "Use the official PostgreSQL image.\n\n```dockerfile\nFROM postgres:16-alpine\nFROM postgres:15-bookworm\n```\n\nSet `POSTGRES_PASSWORD`, `POSTGRES_USER`, `POSTGRES_DB` environment variables. Init scripts in `/docker-entrypoint-initdb.d/`." },
|
|
333
|
+
"insertText": "FROM postgres:${1|16-alpine,16-bookworm,15-alpine,15-bookworm|}",
|
|
334
|
+
"insertTextRules": 4,
|
|
335
|
+
"sortText": "20_postgres"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"label": "FROM mysql",
|
|
339
|
+
"kind": 27,
|
|
340
|
+
"detail": "MySQL base image",
|
|
341
|
+
"documentation": { "value": "Use the official MySQL image.\n\n```dockerfile\nFROM mysql:8.0\nFROM mysql:8.3\n```\n\nSet `MYSQL_ROOT_PASSWORD`, `MYSQL_DATABASE`, `MYSQL_USER`, `MYSQL_PASSWORD`. Init scripts in `/docker-entrypoint-initdb.d/`." },
|
|
342
|
+
"insertText": "FROM mysql:${1|8.3,8.0|}",
|
|
343
|
+
"insertTextRules": 4,
|
|
344
|
+
"sortText": "20_mysql"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"label": "apt-get install pattern",
|
|
348
|
+
"kind": 15,
|
|
349
|
+
"detail": "Best practice apt-get install with cleanup",
|
|
350
|
+
"documentation": { "value": "Install packages with apt-get following Docker best practices: combine update+install, use `--no-install-recommends`, and clean up in a single RUN layer.\n\n```dockerfile\nRUN apt-get update && apt-get install -y --no-install-recommends \\\n curl \\\n ca-certificates \\\n && rm -rf /var/lib/apt/lists/*\n```" },
|
|
351
|
+
"insertText": "RUN apt-get update && apt-get install -y --no-install-recommends \\\n ${1:package} \\\n && rm -rf /var/lib/apt/lists/*",
|
|
352
|
+
"insertTextRules": 4,
|
|
353
|
+
"sortText": "30_apt_install"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"label": "pip install pattern",
|
|
357
|
+
"kind": 15,
|
|
358
|
+
"detail": "Best practice pip install",
|
|
359
|
+
"documentation": { "value": "Install Python packages with pip following best practices: use `--no-cache-dir` to keep image small.\n\n```dockerfile\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n```" },
|
|
360
|
+
"insertText": "COPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt",
|
|
361
|
+
"insertTextRules": 4,
|
|
362
|
+
"sortText": "30_pip_install"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"label": "npm install pattern",
|
|
366
|
+
"kind": 15,
|
|
367
|
+
"detail": "Best practice npm install with layer caching",
|
|
368
|
+
"documentation": { "value": "Copy package files first to leverage Docker layer caching. Dependencies are only reinstalled when package files change.\n\n```dockerfile\nCOPY package.json package-lock.json ./\nRUN npm ci --only=production\nCOPY . .\n```" },
|
|
369
|
+
"insertText": "COPY package.json package-lock.json ./\nRUN npm ci ${1:--only=production}\nCOPY . .",
|
|
370
|
+
"insertTextRules": 4,
|
|
371
|
+
"sortText": "30_npm_install"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"label": "COPY package.json first",
|
|
375
|
+
"kind": 15,
|
|
376
|
+
"detail": "Layer caching pattern for package managers",
|
|
377
|
+
"documentation": { "value": "Copy dependency manifests before the rest of the code to leverage Docker's build cache. This way, dependencies are only reinstalled when the manifest changes.\n\n```dockerfile\n# Dependencies are cached unless package.json changes\nCOPY package.json package-lock.json ./\nRUN npm ci\n\n# Application code changes don't invalidate deps cache\nCOPY . .\n```" },
|
|
378
|
+
"insertText": "# Install dependencies (cached unless manifest changes)\nCOPY ${1:package.json} ${2:package-lock.json} ./\nRUN ${3:npm ci}\n\n# Copy application source\nCOPY . .",
|
|
379
|
+
"insertTextRules": 4,
|
|
380
|
+
"sortText": "30_copy_first"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"label": "ARG + ENV pattern",
|
|
384
|
+
"kind": 15,
|
|
385
|
+
"detail": "Use ARG to set ENV at build time",
|
|
386
|
+
"documentation": { "value": "Combine ARG and ENV to set environment variables that can be overridden at build time and persist at runtime.\n\n```dockerfile\nARG APP_VERSION=1.0.0\nENV APP_VERSION=${APP_VERSION}\n```\n\n`ARG` is only available during build. `ENV` persists in the running container." },
|
|
387
|
+
"insertText": "ARG ${1:VAR_NAME}=${2:default_value}\nENV ${1:VAR_NAME}=${${1:VAR_NAME}}",
|
|
388
|
+
"insertTextRules": 4,
|
|
389
|
+
"sortText": "31_arg_env"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"label": "HEALTHCHECK CMD",
|
|
393
|
+
"kind": 15,
|
|
394
|
+
"detail": "Health check with all options",
|
|
395
|
+
"documentation": { "value": "Configure a health check with interval, timeout, start period, and retries.\n\n```dockerfile\nHEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \\\n CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1\n```\n\nOptions:\n- `--interval=DURATION` (default 30s)\n- `--timeout=DURATION` (default 30s)\n- `--start-period=DURATION` (default 0s)\n- `--retries=N` (default 3)" },
|
|
396
|
+
"insertText": "HEALTHCHECK --interval=${1:30s} --timeout=${2:10s} --start-period=${3:40s} --retries=${4:3} \\\n CMD ${5:wget --no-verbose --tries=1 --spider http://localhost:${6:8080}/health || exit 1}",
|
|
397
|
+
"insertTextRules": 4,
|
|
398
|
+
"sortText": "31_healthcheck"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"label": "Multi-stage builder pattern",
|
|
402
|
+
"kind": 15,
|
|
403
|
+
"detail": "Multi-stage build with builder stage",
|
|
404
|
+
"documentation": { "value": "Use a multi-stage build to compile/build in one stage and copy artifacts to a minimal final image.\n\n```dockerfile\nFROM node:20-alpine AS builder\nWORKDIR /app\nCOPY . .\nRUN npm ci && npm run build\n\nFROM nginx:alpine\nCOPY --from=builder /app/dist /usr/share/nginx/html\nEXPOSE 80\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```" },
|
|
405
|
+
"insertText": "FROM ${1:node:20-alpine} AS builder\nWORKDIR /app\nCOPY . .\nRUN ${2:npm ci && npm run build}\n\nFROM ${3:nginx:alpine}\nCOPY --from=builder ${4:/app/dist} ${5:/usr/share/nginx/html}\nEXPOSE ${6:80}\nCMD [\"${7:nginx}\", \"${8:-g}\", \"${9:daemon off;}\"]",
|
|
406
|
+
"insertTextRules": 4,
|
|
407
|
+
"sortText": "32_multistage_builder"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"label": "Non-root user pattern",
|
|
411
|
+
"kind": 15,
|
|
412
|
+
"detail": "Create and switch to non-root user",
|
|
413
|
+
"documentation": { "value": "Security best practice: run the final container as a non-root user.\n\n```dockerfile\nRUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser\nUSER appuser\n```" },
|
|
414
|
+
"insertText": "RUN addgroup --system ${1:appgroup} && adduser --system --ingroup ${1:appgroup} ${2:appuser}\nUSER ${2:appuser}",
|
|
415
|
+
"insertTextRules": 4,
|
|
416
|
+
"sortText": "33_nonroot_user"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"label": "Dockerfile: Node.js app",
|
|
420
|
+
"kind": 15,
|
|
421
|
+
"detail": "Complete Dockerfile for a Node.js application",
|
|
422
|
+
"documentation": { "value": "Production-ready Dockerfile for a Node.js application with multi-stage build, non-root user, and health check.\n\n```dockerfile\nFROM node:20-alpine AS builder\nWORKDIR /app\nCOPY package.json package-lock.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM node:20-alpine\nRUN addgroup -S app && adduser -S app -G app\nWORKDIR /app\nCOPY --from=builder --chown=app:app /app/dist ./dist\nCOPY --from=builder --chown=app:app /app/node_modules ./node_modules\nCOPY --from=builder --chown=app:app /app/package.json ./\nUSER app\nEXPOSE 3000\nHEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD wget -qO- http://localhost:3000/health || exit 1\nCMD [\"node\", \"dist/index.js\"]\n```" },
|
|
423
|
+
"insertText": "FROM node:${1:20-alpine} AS builder\nWORKDIR /app\nCOPY package.json package-lock.json ./\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM node:${1:20-alpine}\nRUN addgroup -S app && adduser -S app -G app\nWORKDIR /app\nCOPY --from=builder --chown=app:app /app/dist ./dist\nCOPY --from=builder --chown=app:app /app/node_modules ./node_modules\nCOPY --from=builder --chown=app:app /app/package.json ./\nUSER app\nEXPOSE ${2:3000}\nHEALTHCHECK --interval=30s --timeout=10s --retries=3 \\\n CMD wget -qO- http://localhost:${2:3000}/health || exit 1\nCMD [\"node\", \"dist/index.js\"]",
|
|
424
|
+
"insertTextRules": 4,
|
|
425
|
+
"sortText": "40_full_node"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"label": "Dockerfile: Python app",
|
|
429
|
+
"kind": 15,
|
|
430
|
+
"detail": "Complete Dockerfile for a Python application",
|
|
431
|
+
"documentation": { "value": "Production-ready Dockerfile for a Python application with virtual env, non-root user, and best practices.\n\n```dockerfile\nFROM python:3.12-slim AS builder\nWORKDIR /app\nRUN python -m venv /opt/venv\nENV PATH=\"/opt/venv/bin:$PATH\"\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n\nFROM python:3.12-slim\nRUN useradd --create-home appuser\nWORKDIR /app\nCOPY --from=builder /opt/venv /opt/venv\nENV PATH=\"/opt/venv/bin:$PATH\"\nCOPY --chown=appuser:appuser . .\nUSER appuser\nEXPOSE 8000\nCMD [\"python\", \"-m\", \"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]\n```" },
|
|
432
|
+
"insertText": "FROM python:${1:3.12-slim} AS builder\nWORKDIR /app\nRUN python -m venv /opt/venv\nENV PATH=\"/opt/venv/bin:$$PATH\"\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\n\nFROM python:${1:3.12-slim}\nRUN useradd --create-home appuser\nWORKDIR /app\nCOPY --from=builder /opt/venv /opt/venv\nENV PATH=\"/opt/venv/bin:$$PATH\"\nCOPY --chown=appuser:appuser . .\nUSER appuser\nEXPOSE ${2:8000}\nCMD [\"python\", \"-m\", \"${3:uvicorn}\", \"${4:main:app}\", \"--host\", \"0.0.0.0\", \"--port\", \"${2:8000}\"]",
|
|
433
|
+
"insertTextRules": 4,
|
|
434
|
+
"sortText": "40_full_python"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"label": "Dockerfile: Go app",
|
|
438
|
+
"kind": 15,
|
|
439
|
+
"detail": "Complete Dockerfile for a Go application",
|
|
440
|
+
"documentation": { "value": "Production-ready multi-stage Dockerfile for a Go application using scratch as the final image.\n\n```dockerfile\nFROM golang:1.22-alpine AS builder\nWORKDIR /app\nCOPY go.mod go.sum ./\nRUN go mod download\nCOPY . .\nRUN CGO_ENABLED=0 GOOS=linux go build -ldflags='-w -s' -o /app/server ./cmd/server\n\nFROM scratch\nCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/\nCOPY --from=builder /app/server /server\nEXPOSE 8080\nENTRYPOINT [\"/server\"]\n```" },
|
|
441
|
+
"insertText": "FROM golang:${1:1.22-alpine} AS builder\nWORKDIR /app\nCOPY go.mod go.sum ./\nRUN go mod download\nCOPY . .\nRUN CGO_ENABLED=0 GOOS=linux go build -ldflags='-w -s' -o /app/${2:server} ./${3:cmd/server}\n\nFROM scratch\nCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/\nCOPY --from=builder /app/${2:server} /${2:server}\nEXPOSE ${4:8080}\nENTRYPOINT [\"/${2:server}\"]",
|
|
442
|
+
"insertTextRules": 4,
|
|
443
|
+
"sortText": "40_full_go"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"label": "Dockerfile: Multi-stage build",
|
|
447
|
+
"kind": 15,
|
|
448
|
+
"detail": "Generic multi-stage build template",
|
|
449
|
+
"documentation": { "value": "A generic multi-stage build template. First stage builds, second stage runs.\n\n```dockerfile\n# Build stage\nFROM image:tag AS builder\nWORKDIR /app\nCOPY . .\nRUN make build\n\n# Production stage\nFROM image:tag\nWORKDIR /app\nCOPY --from=builder /app/output /app/\nEXPOSE 8080\nCMD [\"./app\"]\n```" },
|
|
450
|
+
"insertText": "# Build stage\nFROM ${1:image}:${2:tag} AS builder\nWORKDIR /app\nCOPY . .\nRUN ${3:make build}\n\n# Production stage\nFROM ${4:image}:${5:tag}\nWORKDIR /app\nCOPY --from=builder /app/${6:output} /app/\nEXPOSE ${7:8080}\nCMD [\"${8:./app}\"]",
|
|
451
|
+
"insertTextRules": 4,
|
|
452
|
+
"sortText": "40_full_multistage"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"label": "Dockerfile: Rust app",
|
|
456
|
+
"kind": 15,
|
|
457
|
+
"detail": "Complete Dockerfile for a Rust application",
|
|
458
|
+
"documentation": { "value": "Production-ready multi-stage Dockerfile for a Rust application.\n\n```dockerfile\nFROM rust:1.77-slim AS builder\nWORKDIR /app\nCOPY Cargo.toml Cargo.lock ./\nRUN mkdir src && echo 'fn main(){}' > src/main.rs && cargo build --release && rm -rf src\nCOPY src ./src\nRUN cargo build --release\n\nFROM debian:bookworm-slim\nRUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*\nCOPY --from=builder /app/target/release/myapp /usr/local/bin/myapp\nEXPOSE 8080\nCMD [\"myapp\"]\n```" },
|
|
459
|
+
"insertText": "FROM rust:${1:1.77-slim} AS builder\nWORKDIR /app\nCOPY Cargo.toml Cargo.lock ./\nRUN mkdir src && echo 'fn main(){}' > src/main.rs && cargo build --release && rm -rf src\nCOPY src ./src\nRUN cargo build --release\n\nFROM debian:bookworm-slim\nRUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*\nCOPY --from=builder /app/target/release/${2:myapp} /usr/local/bin/${2:myapp}\nEXPOSE ${3:8080}\nCMD [\"${2:myapp}\"]",
|
|
460
|
+
"insertTextRules": 4,
|
|
461
|
+
"sortText": "40_full_rust"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"label": "Dockerfile: Nginx static site",
|
|
465
|
+
"kind": 15,
|
|
466
|
+
"detail": "Dockerfile for serving static files with Nginx",
|
|
467
|
+
"documentation": { "value": "Serve a static website or SPA with Nginx.\n\n```dockerfile\nFROM nginx:alpine\nCOPY nginx.conf /etc/nginx/conf.d/default.conf\nCOPY dist/ /usr/share/nginx/html/\nEXPOSE 80\nHEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://localhost/ || exit 1\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```" },
|
|
468
|
+
"insertText": "FROM nginx:alpine\nCOPY ${1:nginx.conf} /etc/nginx/conf.d/default.conf\nCOPY ${2:dist/} /usr/share/nginx/html/\nEXPOSE 80\nHEALTHCHECK --interval=30s --timeout=5s \\\n CMD wget -qO- http://localhost/ || exit 1\nCMD [\"nginx\", \"-g\", \"daemon off;\"]",
|
|
469
|
+
"insertTextRules": 4,
|
|
470
|
+
"sortText": "40_full_nginx"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"label": "apk add pattern",
|
|
474
|
+
"kind": 15,
|
|
475
|
+
"detail": "Alpine package install with cleanup",
|
|
476
|
+
"documentation": { "value": "Install packages on Alpine Linux with `--no-cache` to avoid caching the index.\n\n```dockerfile\nRUN apk add --no-cache \\\n curl \\\n ca-certificates \\\n tzdata\n```" },
|
|
477
|
+
"insertText": "RUN apk add --no-cache \\\n ${1:package}",
|
|
478
|
+
"insertTextRules": 4,
|
|
479
|
+
"sortText": "30_apk_install"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"label": "ENTRYPOINT + CMD pattern",
|
|
483
|
+
"kind": 15,
|
|
484
|
+
"detail": "ENTRYPOINT with CMD as default args",
|
|
485
|
+
"documentation": { "value": "Use ENTRYPOINT for the executable and CMD for default arguments. Users can override CMD args at `docker run`.\n\n```dockerfile\nENTRYPOINT [\"python\", \"app.py\"]\nCMD [\"--port\", \"8000\"]\n\n# docker run myimage -> python app.py --port 8000\n# docker run myimage --port 9000 -> python app.py --port 9000\n```" },
|
|
486
|
+
"insertText": "ENTRYPOINT [\"${1:executable}\"]\nCMD [\"${2:--default-arg}\", \"${3:value}\"]",
|
|
487
|
+
"insertTextRules": 4,
|
|
488
|
+
"sortText": "31_entrypoint_cmd"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"label": ".dockerignore note",
|
|
492
|
+
"kind": 15,
|
|
493
|
+
"detail": "Reminder to create .dockerignore",
|
|
494
|
+
"documentation": { "value": "Always create a `.dockerignore` file to exclude files from the build context, reducing build time and image size.\n\n```\n# .dockerignore\nnode_modules\n.git\n.env\n*.md\nDockerfile\n.dockerignore\ndist\ncoverage\n.nyc_output\n```" },
|
|
495
|
+
"insertText": "# Remember to create a .dockerignore file:\n# node_modules\n# .git\n# .env\n# *.md\n# Dockerfile\n# .dockerignore",
|
|
496
|
+
"insertTextRules": 4,
|
|
497
|
+
"sortText": "50_dockerignore"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"label": "COPY --link",
|
|
501
|
+
"kind": 15,
|
|
502
|
+
"detail": "Copy with independent layer",
|
|
503
|
+
"documentation": { "value": "Use `--link` to create an independent layer that doesn't depend on previous layers, enabling better cache reuse.\n\n```dockerfile\nCOPY --link package.json ./\nCOPY --link --from=builder /app/dist ./dist\n```\n\nAvailable since BuildKit. The layer is not invalidated by changes to prior layers." },
|
|
504
|
+
"insertText": "COPY --link ${1:src} ${2:dest}",
|
|
505
|
+
"insertTextRules": 4,
|
|
506
|
+
"sortText": "08_COPY_link"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"label": "RUN --network=none",
|
|
510
|
+
"kind": 15,
|
|
511
|
+
"detail": "RUN with no network access",
|
|
512
|
+
"documentation": { "value": "Disable network access during a RUN step for security.\n\n```dockerfile\nRUN --network=none cat /etc/hostname\n```" },
|
|
513
|
+
"insertText": "RUN --network=none ${1:command}",
|
|
514
|
+
"insertTextRules": 4,
|
|
515
|
+
"sortText": "01_RUN_nonetwork"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"label": "LABEL OCI metadata",
|
|
519
|
+
"kind": 15,
|
|
520
|
+
"detail": "OCI standard image labels",
|
|
521
|
+
"documentation": { "value": "Apply standardized OCI annotations to your image.\n\n```dockerfile\nLABEL org.opencontainers.image.title=\"My App\" \\\n org.opencontainers.image.description=\"Description\" \\\n org.opencontainers.image.version=\"1.0.0\" \\\n org.opencontainers.image.source=\"https://github.com/user/repo\" \\\n org.opencontainers.image.licenses=\"MIT\"\n```" },
|
|
522
|
+
"insertText": "LABEL org.opencontainers.image.title=\"${1:App Name}\" \\\n org.opencontainers.image.description=\"${2:Description}\" \\\n org.opencontainers.image.version=\"${3:1.0.0}\" \\\n org.opencontainers.image.source=\"${4:https://github.com/user/repo}\" \\\n org.opencontainers.image.licenses=\"${5:MIT}\"",
|
|
523
|
+
"insertTextRules": 4,
|
|
524
|
+
"sortText": "03_LABEL_oci"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"label": "Dockerfile: Java Spring Boot app",
|
|
528
|
+
"kind": 15,
|
|
529
|
+
"detail": "Dockerfile for Java Spring Boot using layered JARs",
|
|
530
|
+
"documentation": { "value": "Multi-stage Dockerfile for a Spring Boot application with dependency layer caching.\n\n```dockerfile\nFROM eclipse-temurin:21-jdk-alpine AS builder\nWORKDIR /app\nCOPY . .\nRUN ./mvnw package -DskipTests\n\nFROM eclipse-temurin:21-jre-alpine\nWORKDIR /app\nCOPY --from=builder /app/target/*.jar app.jar\nRUN addgroup -S spring && adduser -S spring -G spring\nUSER spring\nEXPOSE 8080\nHEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD wget -qO- http://localhost:8080/actuator/health || exit 1\nENTRYPOINT [\"java\", \"-jar\", \"app.jar\"]\n```" },
|
|
531
|
+
"insertText": "FROM eclipse-temurin:${1:21-jdk-alpine} AS builder\nWORKDIR /app\nCOPY . .\nRUN ./mvnw package -DskipTests\n\nFROM eclipse-temurin:${2:21-jre-alpine}\nWORKDIR /app\nCOPY --from=builder /app/target/*.jar app.jar\nRUN addgroup -S spring && adduser -S spring -G spring\nUSER spring\nEXPOSE ${3:8080}\nHEALTHCHECK --interval=30s --timeout=10s --retries=3 \\\n CMD wget -qO- http://localhost:${3:8080}/actuator/health || exit 1\nENTRYPOINT [\"java\", \"-jar\", \"app.jar\"]",
|
|
532
|
+
"insertTextRules": 4,
|
|
533
|
+
"sortText": "40_full_java"
|
|
534
|
+
}
|
|
535
|
+
]
|
|
536
|
+
}
|