Containers and DockerProLesson 29 of 45, about 8 min
- 1
- 2
- 3
- 4
- 5
- 6
- 7
The app: Relay, a CI/CD pipeline
Relayharbor / invoice serviceno image yet
Commit 8d41f2e on both machines. Same code, same request.
Kofi’s laptop
MacBook, where the code was writtenStaging server
harbor-stg-2, where testers try itThe files behind it
Where it runs what each machine has
laptop # Kofi’s laptop
node:
os: macOS 15.1
code: 8d41f2e # the same commit
staging # Staging server
node:
os: Ubuntu 22.04
code: 8d41f2e # the same commit
invoice-lines.js the line staging trips on
// src/invoice-lines.js
export function orderLines(invoice) {
// a sorted copy, so the invoice object stays as it was
return invoice.lines.toSorted((a, b) => a.position - b.position);
}
The MagisterHarbor’s invoice service turns invoices into PDFs. It works on Kofi’s laptop and fails on staging, with the same commit on both. Make a test invoice on each machine, then find the difference on the right that explains the error. Hint: toSorted only arrived in Node 20.
Step 1 of 7Find what differs between the machines
- Make a test invoice on both machines
- Tap the Node version that breaks it
You’re not signed in, so this lesson won’t be saved to your path. Sign in free to keep your XP.