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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<title>Concept to Code Millionaire</title>
|
6 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
8 |
+
</head>
|
9 |
+
<body class="bg-gray-100 min-h-screen flex items-center justify-center p-6">
|
10 |
+
<div class="bg-white p-8 rounded-2xl shadow-xl w-full max-w-2xl">
|
11 |
+
<h1 class="text-4xl font-bold text-indigo-600 text-center mb-2">Concept to Code Millionaire</h1>
|
12 |
+
<p class="text-center text-sm text-gray-500 mb-6">
|
13 |
+
Content source:
|
14 |
+
<a href="https://www.linkedin.com/pulse/docker-from-concept-commands-michael-lively-mndwe/"
|
15 |
+
target="_blank"
|
16 |
+
class="underline hover:text-indigo-700">
|
17 |
+
Docker: From Concept to Commands — Michael Lively (Aug 23, 2025)
|
18 |
+
</a>
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<div id="board">
|
22 |
+
<div id="question" class="text-2xl font-semibold text-gray-800 mb-4"></div>
|
23 |
+
<div id="choices" class="space-y-3"></div>
|
24 |
+
<div id="lifelines" class="flex justify-around mt-6">
|
25 |
+
<button id="life5050" class="lifeline bg-yellow-400 hover:bg-yellow-500 text-white font-medium py-2 px-4 rounded-lg shadow">
|
26 |
+
50:50
|
27 |
+
</button>
|
28 |
+
<button id="lifePoll" class="lifeline bg-blue-400 hover:bg-blue-500 text-white font-medium py-2 px-4 rounded-lg shadow">
|
29 |
+
Ask the Class
|
30 |
+
</button>
|
31 |
+
<button id="lifeHint" class="lifeline bg-green-400 hover:bg-green-500 text-white font-medium py-2 px-4 rounded-lg shadow">
|
32 |
+
Ask an Expert
|
33 |
+
</button>
|
34 |
+
</div>
|
35 |
+
<div id="poll" class="text-sm text-gray-700 mt-4"></div>
|
36 |
+
<div id="hint" class="text-sm italic text-gray-600 mt-2"></div>
|
37 |
+
<button id="next" class="hidden mt-8 bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-6 rounded-lg shadow">
|
38 |
+
Next Question
|
39 |
+
</button>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<script>
|
44 |
+
// 15-question set for Concept to Code Millionaire (Docker-focused)
|
45 |
+
const questions = [
|
46 |
+
{
|
47 |
+
q: "What core problem does Docker directly reduce by packaging apps with all dependencies?",
|
48 |
+
choices: [
|
49 |
+
"\"My CPU is too slow\" problem",
|
50 |
+
"\"It works on my machine\" problem",
|
51 |
+
"Vendor lock-in of cloud credits",
|
52 |
+
"I/O bottlenecks from HDDs"
|
53 |
+
],
|
54 |
+
correct: 1,
|
55 |
+
hint: "The article calls this out explicitly as a dreaded phrase."
|
56 |
+
},
|
57 |
+
{
|
58 |
+
q: "Which single command verifies a fresh Docker install by running a tiny test image?",
|
59 |
+
choices: [
|
60 |
+
"docker info",
|
61 |
+
"docker run hello-world",
|
62 |
+
"docker version",
|
63 |
+
"docker verify install"
|
64 |
+
],
|
65 |
+
correct: 1,
|
66 |
+
hint: "It both pulls and runs a simple image."
|
67 |
+
},
|
68 |
+
{
|
69 |
+
q: "Which statement best describes a Docker image vs. a container?",
|
70 |
+
choices: [
|
71 |
+
"Image is the running process; container is the template",
|
72 |
+
"Image is a blueprint; container is a running instance",
|
73 |
+
"Both are the same thing",
|
74 |
+
"Container builds images automatically"
|
75 |
+
],
|
76 |
+
correct: 1,
|
77 |
+
hint: "Blueprint vs. instance."
|
78 |
+
},
|
79 |
+
{
|
80 |
+
q: "Which pairing lists Docker’s foundational components correctly?",
|
81 |
+
choices: [
|
82 |
+
"Daemon (dockerd) and Client (CLI)",
|
83 |
+
"Supervisor and Operator",
|
84 |
+
"Scheduler and Controller",
|
85 |
+
"Planner and Runner"
|
86 |
+
],
|
87 |
+
correct: 0,
|
88 |
+
hint: "One runs on the host managing objects; one is your command tool."
|
89 |
+
},
|
90 |
+
{
|
91 |
+
q: "On Windows/macOS, which package bundles the daemon, CLI, and helpful tooling?",
|
92 |
+
choices: [
|
93 |
+
"Docker Desktop",
|
94 |
+
"Docker Studio",
|
95 |
+
"Docker Workstation",
|
96 |
+
"Docker Hub Client"
|
97 |
+
],
|
98 |
+
correct: 0,
|
99 |
+
hint: "It’s the standard local install for devs."
|
100 |
+
},
|
101 |
+
{
|
102 |
+
q: "Which registry is highlighted as the most well-known public repository for images?",
|
103 |
+
choices: [
|
104 |
+
"Artifact Registry",
|
105 |
+
"Docker Hub",
|
106 |
+
"Harbor",
|
107 |
+
"Quay"
|
108 |
+
],
|
109 |
+
correct: 1,
|
110 |
+
hint: "It’s the default source used by many docker pull commands."
|
111 |
+
},
|
112 |
+
{
|
113 |
+
q: "Which two commands run Nginx locally and map container port 80 to host 8080?",
|
114 |
+
choices: [
|
115 |
+
"docker pull nginx && docker run -d -p 8080:80 nginx",
|
116 |
+
"docker build nginx && docker start -p 8080:80 nginx",
|
117 |
+
"docker fetch nginx && docker exec -p 8080:80 nginx",
|
118 |
+
"docker clone nginx && docker up -p 8080:80"
|
119 |
+
],
|
120 |
+
correct: 0,
|
121 |
+
hint: "First pull, then run detached with -p host:container."
|
122 |
+
},
|
123 |
+
{
|
124 |
+
q: "In a typical Docker development flow, which file defines how to build your image?",
|
125 |
+
choices: [
|
126 |
+
"compose.yaml",
|
127 |
+
"Dockerfile",
|
128 |
+
"package.json",
|
129 |
+
"Container.toml"
|
130 |
+
],
|
131 |
+
correct: 1,
|
132 |
+
hint: "It’s a plain text set of build instructions."
|
133 |
+
},
|
134 |
+
{
|
135 |
+
q: "Which docker build/run pair correctly tags and launches an app on port 5000?",
|
136 |
+
choices: [
|
137 |
+
"docker build -t myapp:1.0 . && docker run -d -p 5000:5000 myapp:1.0",
|
138 |
+
"docker build myapp . && docker start -p 5000:5000 myapp",
|
139 |
+
"docker compile -t myapp . && docker exec -p 5000 myapp",
|
140 |
+
"docker make -t myapp . && docker deploy -p 5000 myapp"
|
141 |
+
],
|
142 |
+
correct: 0,
|
143 |
+
hint: "Tag with -t, then run detached with -p host:container."
|
144 |
+
},
|
145 |
+
{
|
146 |
+
q: "Which command set focuses on day-to-day container lifecycle operations?",
|
147 |
+
choices: [
|
148 |
+
"docker ps, docker stop, docker rm, docker logs",
|
149 |
+
"docker get, docker halt, docker purge, docker read",
|
150 |
+
"docker view, docker end, docker delete, docker cat",
|
151 |
+
"docker list, docker kill, docker trash, docker echo"
|
152 |
+
],
|
153 |
+
correct: 0,
|
154 |
+
hint: "These are the canonical verbs shown in the article."
|
155 |
+
},
|
156 |
+
{
|
157 |
+
q: "What’s a recommended practice for keeping images small and efficient?",
|
158 |
+
choices: [
|
159 |
+
"Install all dev tools into the final image",
|
160 |
+
"Use multi-stage builds and small base images (e.g., alpine)",
|
161 |
+
"Bundle multiple apps in one container",
|
162 |
+
"Avoid .dockerignore to include everything"
|
163 |
+
],
|
164 |
+
correct: 1,
|
165 |
+
hint: "Less is more—stage builds and tiny bases."
|
166 |
+
},
|
167 |
+
{
|
168 |
+
q: "Which command safely reclaims disk by removing all unused images?",
|
169 |
+
choices: [
|
170 |
+
"docker image prune -a",
|
171 |
+
"docker images --rm all",
|
172 |
+
"docker clean images",
|
173 |
+
"docker rmi --unused"
|
174 |
+
],
|
175 |
+
correct: 0,
|
176 |
+
hint: "Prune is the keyword."
|
177 |
+
},
|
178 |
+
{
|
179 |
+
q: "What’s the simplest way to cluster Docker for small projects using built-in tooling?",
|
180 |
+
choices: [
|
181 |
+
"Enable Swarm with docker swarm init",
|
182 |
+
"Install Kubernetes the hard way",
|
183 |
+
"Write a custom scheduler",
|
184 |
+
"Use a systemd unit file"
|
185 |
+
],
|
186 |
+
correct: 0,
|
187 |
+
hint: "Built into Docker itself."
|
188 |
+
},
|
189 |
+
{
|
190 |
+
q: "Which statement best captures Swarm vs. Kubernetes in the article?",
|
191 |
+
choices: [
|
192 |
+
"Swarm is feature-richer than Kubernetes for enterprises",
|
193 |
+
"Kubernetes is the de facto standard for large-scale orchestration",
|
194 |
+
"Both are equally adopted in production",
|
195 |
+
"Swarm has a larger ecosystem than Kubernetes"
|
196 |
+
],
|
197 |
+
correct: 1,
|
198 |
+
hint: "Think industry adoption and ecosystem."
|
199 |
+
},
|
200 |
+
{
|
201 |
+
q: "Which Kubernetes command sequence mirrors the article’s quick start?",
|
202 |
+
choices: [
|
203 |
+
"minikube start → kubectl create deployment nginx --image=nginx → kubectl expose deployment nginx --port=80 --type=NodePort",
|
204 |
+
"kubeadm up → kctl make deploy nginx → kctl service open 80",
|
205 |
+
"kubestart → kubectl add nginx → kubectl publish 80",
|
206 |
+
"kind boot → kubectl run nginx --image=nginx → kubectl open service 80"
|
207 |
+
],
|
208 |
+
correct: 0,
|
209 |
+
hint: "Minikube, create deployment, then expose with NodePort."
|
210 |
+
}
|
211 |
+
];
|
212 |
+
|
213 |
+
const prizes = [100,200,300,500,1000,2000,4000,8000,16000,32000,64000,125000,250000,500000,1000000];
|
214 |
+
let idx = 0;
|
215 |
+
let currentPrize = prizes[0];
|
216 |
+
|
217 |
+
// Evenly distribute correct answers across A–D
|
218 |
+
questions.forEach((q, i) => {
|
219 |
+
const target = i % 4; // 0=A,1=B,2=C,3=D pattern
|
220 |
+
if (q.correct !== target) {
|
221 |
+
[q.choices[target], q.choices[q.correct]] = [q.choices[q.correct], q.choices[target]];
|
222 |
+
q.correct = target;
|
223 |
+
}
|
224 |
+
});
|
225 |
+
|
226 |
+
const qEl = document.getElementById('question');
|
227 |
+
const cEl = document.getElementById('choices');
|
228 |
+
const pollEl = document.getElementById('poll');
|
229 |
+
const hintEl = document.getElementById('hint');
|
230 |
+
const nextBtn = document.getElementById('next');
|
231 |
+
const boardEl = document.getElementById('board');
|
232 |
+
|
233 |
+
function updateQuestionDisplay() {
|
234 |
+
qEl.textContent = `$${currentPrize}: ${questions[idx].q}`;
|
235 |
+
}
|
236 |
+
|
237 |
+
function showQuestion() {
|
238 |
+
['life5050','lifePoll','lifeHint'].forEach(id => {
|
239 |
+
const btn = document.getElementById(id);
|
240 |
+
btn.disabled = false;
|
241 |
+
btn.classList.remove('opacity-50');
|
242 |
+
});
|
243 |
+
pollEl.textContent = '';
|
244 |
+
hintEl.textContent = '';
|
245 |
+
nextBtn.classList.add('hidden');
|
246 |
+
|
247 |
+
currentPrize = prizes[idx];
|
248 |
+
updateQuestionDisplay();
|
249 |
+
|
250 |
+
cEl.innerHTML = questions[idx].choices.map((ch,i) =>
|
251 |
+
`<button class="choice bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2 px-4 rounded w-full" data-i="${i}">
|
252 |
+
${String.fromCharCode(65+i)}. ${ch}
|
253 |
+
</button>`
|
254 |
+
).join('');
|
255 |
+
|
256 |
+
document.querySelectorAll('.choice').forEach(btn => {
|
257 |
+
btn.disabled = false;
|
258 |
+
btn.onclick = selectAnswer;
|
259 |
+
});
|
260 |
+
}
|
261 |
+
|
262 |
+
function selectAnswer(e) {
|
263 |
+
const chosen = +e.target.dataset.i;
|
264 |
+
const corr = questions[idx].correct;
|
265 |
+
document.querySelectorAll('.choice').forEach(b => b.disabled = true);
|
266 |
+
|
267 |
+
if (chosen === corr) {
|
268 |
+
e.target.classList.replace('bg-indigo-500','bg-green-500');
|
269 |
+
} else {
|
270 |
+
e.target.classList.replace('bg-indigo-500','bg-red-500');
|
271 |
+
const correctBtn = document.querySelector(\`.choice[data-i="\${corr}"]\`);
|
272 |
+
if (correctBtn) correctBtn.classList.replace('bg-indigo-500','bg-green-500');
|
273 |
+
}
|
274 |
+
nextBtn.classList.remove('hidden');
|
275 |
+
}
|
276 |
+
|
277 |
+
// 50:50 Lifeline
|
278 |
+
document.getElementById('life5050').onclick = () => {
|
279 |
+
const btn = document.getElementById('life5050');
|
280 |
+
if (btn.disabled) return;
|
281 |
+
btn.disabled = true;
|
282 |
+
btn.classList.add('opacity-50');
|
283 |
+
|
284 |
+
const corr = questions[idx].correct;
|
285 |
+
questions[idx].choices
|
286 |
+
.map((_, i) => i)
|
287 |
+
.filter(i => i !== corr)
|
288 |
+
.sort(() => Math.random() - 0.5)
|
289 |
+
.slice(0, 2)
|
290 |
+
.forEach(i => {
|
291 |
+
const b = document.querySelector(\`.choice[data-i="\${i}"]\`);
|
292 |
+
if (b) {
|
293 |
+
b.disabled = true;
|
294 |
+
b.classList.add('opacity-50');
|
295 |
+
}
|
296 |
+
});
|
297 |
+
|
298 |
+
// Halve the current prize when using 50:50, as in classic formats
|
299 |
+
currentPrize = Math.floor(currentPrize / 2);
|
300 |
+
updateQuestionDisplay();
|
301 |
+
};
|
302 |
+
|
303 |
+
// Ask the Class
|
304 |
+
document.getElementById('lifePoll').onclick = () => {
|
305 |
+
const btn = document.getElementById('lifePoll');
|
306 |
+
if (btn.disabled) return;
|
307 |
+
btn.disabled = true;
|
308 |
+
btn.classList.add('opacity-50');
|
309 |
+
|
310 |
+
const corr = questions[idx].correct;
|
311 |
+
const pct = [0,0,0,0];
|
312 |
+
pct[corr] = 70 + Math.floor(Math.random() * 21); // 70–90% on correct
|
313 |
+
let rem = 100 - pct[corr];
|
314 |
+
|
315 |
+
const others = [0,1,2,3].filter(i => i !== corr);
|
316 |
+
others.forEach((i, j) => {
|
317 |
+
const last = j === others.length - 1;
|
318 |
+
const alloc = last ? rem : Math.floor(rem / (others.length - j));
|
319 |
+
pct[i] = alloc;
|
320 |
+
rem -= alloc;
|
321 |
+
});
|
322 |
+
|
323 |
+
pollEl.textContent = `Class Poll: A:${pct[0]}% B:${pct[1]}% C:${pct[2]}% D:${pct[3]}%`;
|
324 |
+
};
|
325 |
+
|
326 |
+
// Ask an Expert
|
327 |
+
document.getElementById('lifeHint').onclick = () => {
|
328 |
+
const btn = document.getElementById('lifeHint');
|
329 |
+
if (btn.disabled) return;
|
330 |
+
btn.disabled = true;
|
331 |
+
btn.classList.add('opacity-50');
|
332 |
+
hintEl.textContent = `Expert Hint: ${questions[idx].hint}`;
|
333 |
+
};
|
334 |
+
|
335 |
+
// Next Question
|
336 |
+
nextBtn.onclick = () => {
|
337 |
+
idx++;
|
338 |
+
if (idx < questions.length) {
|
339 |
+
showQuestion();
|
340 |
+
} else {
|
341 |
+
boardEl.innerHTML = '<div class="text-3xl font-bold text-green-600 text-center">🎉 Congratulations! You’ve mastered Concept to Code Millionaire! 🎉</div>';
|
342 |
+
}
|
343 |
+
};
|
344 |
+
|
345 |
+
// Start
|
346 |
+
showQuestion();
|
347 |
+
</script>
|
348 |
+
</body>
|
349 |
</html>
|