Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Stop Running chmod 777 in Dockerfiles: Least-Privilege Linux Permissions & BuildKit --chmod Cheatsheet

Whenever a containerized app throws EACCES: permission denied in CI or Kubernetes, the fastest "fix" people reach for is: RUN chmod -R 777 /app It makes the error disappear—and immediately breaks CIS Docker Benchmark hardening, lets any compromised subprocess overwrite your application binaries, and doubles your container image size because Docker creates a full copy-on-write layer for every…

Running chmod 777 in Dockerfiles poses significant security risks, including granting excessive permissions to all users, breaking CIS Docker Benchmark hardening, allowing compromised subprocesses to overwrite application binaries, and increasing container image size. To address this issue in 2026, a production-safe approach to Linux and Docker file permissions is recommended.

Five production modes for Linux file permissions are outlined, including octal, symbolic, and use case examples. These modes range from read-only for TLS private keys to executable and non-executable permissions for various files and directories. It is crucial never to use 666 (world-writable) or 777 (world-writable) permissions.

To improve build processes, it is advised to use BuildKit's COPY --chown --chmod command instead of the traditional RUN chmod -R. This approach eliminates the need for duplicate image layers and ensures exact least-privilege permissions on every file. An interactive Chmod & Dockerfile Permission Calculator is available for free to help users toggle permissions and generate ready-to-paste commands.

Try the Free Interactive Chmod & Dockerfile Snippet Generator to streamline your Dockerfile permissions and enhance security in your containerized applications.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

A catalogue-only Postgres role for nightly RLS drift checks (measured on PG17)

A monitoring job that reads pg_catalog does not need to read a single application row. I wanted to verify that claim instead of repeating it, so I ran a small local experiment.

  • Monitoring role 'rlsmonitor' created with limited privileges
  • Nightly RLS drift checks performed using 12 SQL checks
  • Monitoring role accessed pgcatalog and informationschema

Introducing RepoLens: Looking Beyond the Code 🔍

A small project, a lot of learning, and my first public release. I've always been interested in building tools that solve practical problems for developers.

  • RepoLens analyzes code repositories to assess code quality metrics
  • Creator Aditya Tyagi aimed to evaluate aspects beyond just functional code
  • Metrics include comment density, long line analysis, and README quality

More from Saturday, 28 November 2026 →