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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8" />
|
5 |
+
<title>Intro to Containers Fact or Fiction</title>
|
6 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap" rel="stylesheet">
|
8 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
9 |
+
<style>
|
10 |
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
11 |
+
:root {
|
12 |
+
--bg1:#c9e8ff; --bg2:#fde2ff; --ink:#222; --ink-sub:#555;
|
13 |
+
--brand:#2563eb; --brand-2:#22c55e; --good:#16a34a; --bad:#dc2626;
|
14 |
+
--card:#ffffffcc;
|
15 |
+
}
|
16 |
+
body {
|
17 |
+
font-family: 'Poppins', sans-serif;
|
18 |
+
background: radial-gradient(1200px 600px at 20% 0%, var(--bg1), transparent 60%),
|
19 |
+
radial-gradient(1200px 600px at 80% 0%, var(--bg2), transparent 60%),
|
20 |
+
#f6f7fb;
|
21 |
+
min-height: 100vh;
|
22 |
+
display: flex;
|
23 |
+
flex-direction: column;
|
24 |
+
align-items: center;
|
25 |
+
justify-content: flex-start;
|
26 |
+
padding: 2rem 1rem;
|
27 |
+
color: var(--ink);
|
28 |
+
}
|
29 |
+
h1 { text-align: center; margin-bottom: .25rem; font-weight: 600; font-size: 2.2rem; }
|
30 |
+
#subtitle { text-align:center; margin-bottom:1rem; color: var(--ink-sub); }
|
31 |
+
#source-link { text-align: center; margin-bottom: 1.25rem; font-size: .95rem; }
|
32 |
+
#source-link a { color: var(--ink); text-decoration: underline; }
|
33 |
+
#game-container {
|
34 |
+
background: var(--card);
|
35 |
+
width: 100%; max-width: 820px;
|
36 |
+
padding: 2rem; border-radius: 16px;
|
37 |
+
box-shadow: 0 10px 24px rgba(0,0,0,.15);
|
38 |
+
display: flex; flex-direction: column; align-items: center;
|
39 |
+
}
|
40 |
+
.progress-container {
|
41 |
+
width: 100%; background:#ececec; border-radius: 999px; overflow: hidden; margin-bottom: 1rem;
|
42 |
+
}
|
43 |
+
.progress-bar { height: 14px; width:0%; background: linear-gradient(90deg,var(--brand),var(--brand-2)); transition: width .3s ease; }
|
44 |
+
#statement {
|
45 |
+
font-size: 1.25rem; line-height: 1.5; text-align: center; color: #333;
|
46 |
+
min-height: 90px; margin: .75rem 0 1rem;
|
47 |
+
}
|
48 |
+
.btn-group { display:flex; gap:.75rem; flex-wrap:wrap; justify-content:center; margin: .25rem 0 1rem; }
|
49 |
+
button {
|
50 |
+
padding: .75rem 1.25rem; border: none; border-radius: 999px; cursor: pointer;
|
51 |
+
background: var(--brand); color: #fff; font-weight: 600; letter-spacing:.2px;
|
52 |
+
transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
|
53 |
+
}
|
54 |
+
button.secondary { background:#111827; }
|
55 |
+
button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.15); }
|
56 |
+
#result {
|
57 |
+
margin-top: .5rem; padding: .75rem 1rem; border-radius: 10px; font-weight: 700; text-align: center; display:none;
|
58 |
+
}
|
59 |
+
#result.correct { display:block; background:#dcfce7; color:#14532d; }
|
60 |
+
#result.incorrect { display:block; background:#fee2e2; color:#7f1d1d; }
|
61 |
+
#explanation {
|
62 |
+
margin-top: .75rem; padding: 1rem; background:#f9fafb; color:#374151; border-radius:12px; display:none;
|
63 |
+
}
|
64 |
+
#score { margin-top: .75rem; font-weight: 700; }
|
65 |
+
#controls { display:flex; gap:.5rem; margin-top:.5rem; }
|
66 |
+
#controls button { background:#0f766e; }
|
67 |
+
#restart-btn { background:#6b21a8; }
|
68 |
+
</style>
|
69 |
+
</head>
|
70 |
+
<body>
|
71 |
+
<h1>Intro to Containers Fact or Fiction</h1>
|
72 |
+
<div id="subtitle">Test your knowledge of Containers, Docker, and Kubernetes</div>
|
73 |
+
<div id="source-link">
|
74 |
+
Source: <a href="https://www.linkedin.com/pulse/introduction-containers-docker-kubernetes-michael-lively-5c1be/" target="_blank" rel="noopener">
|
75 |
+
Introduction to Containers, Docker, and Kubernetes (LinkedIn)
|
76 |
+
</a>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
<div id="game-container">
|
80 |
+
<div class="progress-container"><div class="progress-bar" id="progress-bar"></div></div>
|
81 |
+
<div id="statement">Loading statement...</div>
|
82 |
+
|
83 |
+
<div class="btn-group">
|
84 |
+
<button onclick="guess(true)">Fact</button>
|
85 |
+
<button class="secondary" onclick="guess(false)">Fiction</button>
|
86 |
+
</div>
|
87 |
+
|
88 |
+
<div id="result"></div>
|
89 |
+
<div id="explanation"></div>
|
90 |
+
|
91 |
+
<div id="controls">
|
92 |
+
<button id="next-btn" style="display:none;" onclick="nextStatement()">Next</button>
|
93 |
+
<button id="restart-btn" style="display:none;" onclick="startGame()">Restart</button>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<div id="score"></div>
|
97 |
+
</div>
|
98 |
+
|
99 |
+
<script>
|
100 |
+
// 12 statements (6 Fact, 6 Fiction) derived from your article
|
101 |
+
const statements = [
|
102 |
+
// FACTS (6)
|
103 |
+
{
|
104 |
+
text: "Containers share the host machine’s kernel instead of bundling a full operating system.",
|
105 |
+
isFact: true,
|
106 |
+
explanation: "Fact. Containers virtualize the OS level and share the host kernel, making them lightweight and fast."
|
107 |
+
},
|
108 |
+
{
|
109 |
+
text: "Docker’s 2013 release popularized containerization by standardizing images and registries.",
|
110 |
+
isFact: true,
|
111 |
+
explanation: "Fact. Docker simplified packaging, sharing, and running applications via images and registries."
|
112 |
+
},
|
113 |
+
{
|
114 |
+
text: "Kubernetes, introduced by Google in 2014, became the de facto standard for container orchestration.",
|
115 |
+
isFact: true,
|
116 |
+
explanation: "Fact. Kubernetes handles scheduling, scaling, load balancing, and resilience across clusters."
|
117 |
+
},
|
118 |
+
{
|
119 |
+
text: "OCI (Open Container Initiative) helps ensure interoperability across container tools and platforms.",
|
120 |
+
isFact: true,
|
121 |
+
explanation: "Fact. OCI standards make images and runtimes work consistently across ecosystems."
|
122 |
+
},
|
123 |
+
{
|
124 |
+
text: "Containers typically start in seconds and are more resource-efficient than VMs.",
|
125 |
+
isFact: true,
|
126 |
+
explanation: "Fact. Their smaller footprint and shared kernel enable rapid startup and efficient resource use."
|
127 |
+
},
|
128 |
+
{
|
129 |
+
text: "Containers are a natural fit for microservices, enabling independent deployment and scaling of services.",
|
130 |
+
isFact: true,
|
131 |
+
explanation: "Fact. Each service runs in its own container, improving isolation, agility, and resilience."
|
132 |
+
},
|
133 |
+
|
134 |
+
// FICTIONS (6)
|
135 |
+
{
|
136 |
+
text: "Containers always include a full guest operating system, just like virtual machines.",
|
137 |
+
isFact: false,
|
138 |
+
explanation: "Fiction. Unlike VMs, containers don’t carry a full OS; they share the host kernel."
|
139 |
+
},
|
140 |
+
{
|
141 |
+
text: "Containers completely replace virtual machines in every scenario.",
|
142 |
+
isFact: false,
|
143 |
+
explanation: "Fiction. They’re complementary: many orgs keep some workloads on VMs and run cloud-native apps in containers."
|
144 |
+
},
|
145 |
+
{
|
146 |
+
text: "Kubernetes is a container runtime that eliminates the need for Docker or CRI-O.",
|
147 |
+
isFact: false,
|
148 |
+
explanation: "Fiction. Kubernetes is an orchestrator; it relies on OCI-compatible runtimes (e.g., containerd, CRI-O)."
|
149 |
+
},
|
150 |
+
{
|
151 |
+
text: "Containers are poor choices for hybrid or multi-cloud deployments because they lack portability.",
|
152 |
+
isFact: false,
|
153 |
+
explanation: "Fiction. Portability is a key benefit—containers run across on-prem, cloud, and edge environments."
|
154 |
+
},
|
155 |
+
{
|
156 |
+
text: "Observability is optional for containerized systems; tracing and metrics add little value.",
|
157 |
+
isFact: false,
|
158 |
+
explanation: "Fiction. Observability is critical; teams use Prometheus, Grafana, and OpenTelemetry to operate at scale."
|
159 |
+
},
|
160 |
+
{
|
161 |
+
text: "Security tools like Trivy, Aqua, and StackRox are unrelated to containers.",
|
162 |
+
isFact: false,
|
163 |
+
explanation: "Fiction. These tools help scan images, enforce policies, and secure containerized workloads."
|
164 |
+
}
|
165 |
+
];
|
166 |
+
|
167 |
+
// Game logic (shuffle, progress, scoring)
|
168 |
+
let currentIndex = 0, score = 0, answered = false;
|
169 |
+
|
170 |
+
function shuffle(arr) {
|
171 |
+
for (let i = arr.length - 1; i > 0; i--) {
|
172 |
+
const j = Math.floor(Math.random() * (i + 1));
|
173 |
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
function startGame() {
|
178 |
+
shuffle(statements);
|
179 |
+
currentIndex = 0; score = 0; answered = false;
|
180 |
+
document.getElementById('restart-btn').style.display = 'none';
|
181 |
+
loadStatement(); updateScore();
|
182 |
+
}
|
183 |
+
|
184 |
+
function loadStatement() {
|
185 |
+
if (currentIndex >= statements.length) return endGame();
|
186 |
+
const s = statements[currentIndex];
|
187 |
+
document.getElementById('statement').textContent = s.text;
|
188 |
+
document.getElementById('result').style.display = 'none';
|
189 |
+
document.getElementById('explanation').style.display = 'none';
|
190 |
+
document.getElementById('next-btn').style.display = 'none';
|
191 |
+
answered = false; updateProgress();
|
192 |
+
}
|
193 |
+
|
194 |
+
function guess(isFactGuess) {
|
195 |
+
if (answered) return;
|
196 |
+
answered = true;
|
197 |
+
const correct = statements[currentIndex].isFact;
|
198 |
+
const resultEl = document.getElementById('result');
|
199 |
+
if (isFactGuess === correct) {
|
200 |
+
resultEl.textContent = 'Correct!';
|
201 |
+
resultEl.className = 'correct';
|
202 |
+
score++;
|
203 |
+
} else {
|
204 |
+
resultEl.textContent = 'Incorrect!';
|
205 |
+
resultEl.className = 'incorrect';
|
206 |
+
}
|
207 |
+
resultEl.style.display = 'block';
|
208 |
+
const expEl = document.getElementById('explanation');
|
209 |
+
expEl.textContent = statements[currentIndex].explanation + " (See source link above.)";
|
210 |
+
expEl.style.display = 'block';
|
211 |
+
document.getElementById('next-btn').style.display = 'inline-block';
|
212 |
+
updateScore();
|
213 |
+
}
|
214 |
+
|
215 |
+
function nextStatement() {
|
216 |
+
currentIndex++;
|
217 |
+
if (currentIndex < statements.length) loadStatement();
|
218 |
+
else endGame();
|
219 |
+
}
|
220 |
+
|
221 |
+
function updateScore() {
|
222 |
+
document.getElementById('score').textContent = `Score: ${score} / ${statements.length}`;
|
223 |
+
}
|
224 |
+
|
225 |
+
function updateProgress() {
|
226 |
+
document.getElementById('progress-bar').style.width = `${(currentIndex / statements.length) * 100}%`;
|
227 |
+
}
|
228 |
+
|
229 |
+
function endGame() {
|
230 |
+
const pct = Math.round((score / statements.length) * 100);
|
231 |
+
document.getElementById('statement').textContent =
|
232 |
+
`Game Over! You scored ${score} of ${statements.length} (${pct}%).`;
|
233 |
+
document.getElementById('result').style.display = 'none';
|
234 |
+
document.getElementById('explanation').style.display = 'none';
|
235 |
+
document.getElementById('next-btn').style.display = 'none';
|
236 |
+
document.getElementById('restart-btn').style.display = 'inline-block';
|
237 |
+
document.getElementById('progress-bar').style.width = '100%';
|
238 |
+
}
|
239 |
+
|
240 |
+
startGame();
|
241 |
+
</script>
|
242 |
+
</body>
|
243 |
</html>
|