Bitpath

Boss lesson · Unit 04

Ship it

Tag a release, build it in CI, push it, check its health, roll it back

13 exercisesabout 3 min

What you practise

  • Tagging for releases, building in CI, pushing to a registry, health checks, rolling back to the previous tag

Try a question from this lesson

Pick one

Production runs shop/api:latest. Today's push to latest is broken, and you want yesterday's image back. What is the problem?

Hint

A tag points at one image at a time. Where does latest point now?

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

One tag per release

Give every build a tag that is never reused: a version number, or the hash of the commit it was built from.

Then the registry holds every release side by side. Deploying means choosing a tag. Rolling back means choosing the previous one.

shell
docker build -t shop/api:1.5.0 .
docker push shop/api:1.5.0

Concept

Running is not healthy

A process can be alive and answer nothing. HEALTHCHECK gives Docker a command to run inside the container on a schedule. Exit code 0 counts as a pass.

The container starts as starting, becomes healthy on a pass, and unhealthy after --retries failures in a row. A deploy can wait for healthy before sending traffic.

Dockerfile
HEALTHCHECK --interval=10s --retries=3 \
  CMD curl -f http://localhost:8000/up \
    || exit 1

10 more exercises in the app

  • 4× multiple choice
  • 1× order the lines
  • 1× fill the blanks
  • 1× true or false
  • 2× type the answer
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy