Nine ContainerOps Habits to Retire This Year

Rajesh Kumar

Rajesh Kumar is a leading expert in DevOps, SRE, DevSecOps, and MLOps, providing comprehensive services through his platform, www.rajeshkumar.xyz. With a proven track record in consulting, training, freelancing, and enterprise support, he empowers organizations to adopt modern operational practices and achieve scalable, secure, and efficient IT infrastructures. Rajesh is renowned for his ability to deliver tailored solutions and hands-on expertise across these critical domains.

Most teams do not set out to run containers badly. They pick up habits one at a time, mostly in a hurry, and each habit seems fine until the day it is not. This list gathers nine of them, in friendly order from the easiest to retire to the one that needs a conversation. The source is the anti-pattern section of the Ops Atlas entry on ContainerOps, a label the Atlas uses for the care of individual containers, images and registries below any cluster scheduler.

You do not need to fix everything at once. Pick the habit that rings the loudest bell for your team, replace it, and come back for the next one next month.

1. Pulling whatever the latest tag points at

The word latest sounds reassuring, as if it promised the freshest and safest build. In reality it simply names whichever build someone published last, and it can change under you between two deployments. The Atlas puts floating tags in production at the top of its list of anti-patterns.

Replace it with: a reference by digest, plus release tags that are written once and never moved. When a result looks wrong, you can then name the exact build that produced it.

2. Deploying by tag in the first place

Even a version number is only a label, and labels can be re-pointed by accident or by a rushed colleague. This habit is close to the first, but it is worth listing separately because teams often fix one and not the other.

Replace it with: promoting an image through your environments by its digest, so that what passed testing is, byte for byte, what reaches production.

3. Fixing a running container by hand

Everyone has opened a shell in a live container to change a setting at midnight. The fix works until the container restarts, at which point it quietly vanishes and nobody remembers what was done. The Atlas lists patching through exec among its anti-patterns, for exactly this reason.

Replace it with: editing the build file, rebuilding the image and deploying the new digest. It feels slower for the first minute and is faster for every minute after.

4. Running a scanner and stopping there

A scan produces a list of known weaknesses. In the Atlas’s blunt phrase, a scan with no quick rebuild behind it produces a list rather than a repair. Plenty of teams carry long reports that nobody can act on because rebuilding takes a week.

Replace it with: a build pipeline that can produce a fresh image on demand, plus a bot that moves base images forward. Track how long a known problem takes to reach production and shorten that number gradually.

5. Letting log files grow forever

The default json-file logging driver does not rotate its files. A busy service writes more each day until the host disk is full and everything on that machine stalls, usually on a weekend. Because the cause is so dull, it is often the last thing people check.

Replace it with: a rotation setting with a size and file count, set once at the daemon level so every new container inherits it.

6. Handing a container the key to the engine

Handy tools ask for the Docker socket so they can launch other containers. The Atlas treats that, along with putting people in the docker group, as equivalent to granting root on the host. A compromise of that one container becomes a compromise of the machine.

Replace it with: a narrower integration, such as a build service that runs separately, or a rootless setup where the engine itself has no special rights. If the socket is unavoidable, isolate that container and keep it off public networks.

7. Reaching for the privileged flag

When a program complains about permissions, the privileged flag makes the complaint stop. It also removes most of the isolation that made a container worth using. It is the container equivalent of turning off a smoke alarm because it beeps while you cook.

Replace it with: finding out which single capability or device the program really needs, and granting just that. Start with every capability dropped and add back one at a time.

8. Running everything as the administrator account

Containers start as the administrator user unless you say otherwise, and many tutorials never say otherwise. If an attacker or a bug takes over such a process, it begins with far more power than it ever needed. The Atlas treats a numbered unprivileged user, with all capabilities dropped and a read-only root filesystem, as a baseline.

Replace it with: a dedicated user in the build file, then a test run to find the directories your program really writes to. Give it a small writable volume for those and nothing more.

9. Leaving images with no owner

This one is the quietest. A service built three years ago by someone who has since moved on keeps running, its base image slowly ageing, and no team’s roadmap mentions it. The Atlas describes unowned estates ageing quietly as a pattern of its own.

Replace it with: a simple table of services with a named owner and a last-rebuilt date, reviewed once a quarter. Anything without an owner gets a decision: adopt it, retire it or accept the risk in writing.

What retirement looks like in practice

Nobody has to be blamed for an old habit, because every one of them was once a sensible shortcut. A useful ritual is a short monthly review where the team picks one item, checks how many services still show it and agrees on a date by which that count should be lower. Keep the meeting under half an hour, record the count and move on.

It also helps to keep a small file of replacements that worked: the exact lines in a build file, the daemon setting for log rotation, the command to inspect a container’s user. Newcomers can then copy a tested answer rather than rediscover it, and the list of habits to retire shrinks without anyone feeling lectured.

A note on bringing the team along

Retiring habits is a people problem as much as a technical one. Our look at how culture change is managed in DevOps teams offers useful framing, and the structure and trade-offs of cross-functional teams shows why the owner column matters so much when responsibility is shared. If a new term trips anyone up while you work through this list, the beginner glossary of DevOps terms is a handy reference.

A word on the myths that keep old habits alive

Some habits survive because of half-truths. One is the belief that pinning an image by digest means you will never get security fixes again. That is only true when nothing updates the pin; with a bot proposing new bases, pinning and freshness go together. Another is the idea that every container must hold exactly one process, forever. The Atlas calls that a good rule of thumb, not a hard and fast rule, so do not contort a design just to satisfy it.

How to start on Monday

Choose the three habits you recognise most easily. Count how many of your services show each one, and write the numbers down. The number is your baseline, and watching it fall over a quarter is more motivating than any lecture. For background and further detail, the Atlas page that sets out ContainerOps explains each anti-pattern and its alternatives.

Habits change slowly, but they change. Next year’s list will have different items on it, and that is a good sign.

Leave a Reply