blitz.cloudPricing
EnglishEN
Sign inPut your app onlineStart

Dockerfile check

Paste a Dockerfile or a public GitHub repository and see what will break the build or the start: missing EXPOSE, latest tags, apt-get without -y, secrets in ENV and more.

BlitzWorks · Updated

Paste your Dockerfile below and the check reads it line by line. It runs in your browser and nothing is sent to us. The rules are the ones our own build applies when it reads a project's Dockerfile, plus the Docker mistakes we see most in builds that fail.

github.com/owner/repo, a branch (tree/main) or a file (blob/main/api/Dockerfile)

Everything runs in your browser. Your Dockerfile is not sent to us; only the GitHub fetch goes to raw.githubusercontent.com.

1 error, 4 warnings, 4 notes

  1. Errorline 4apt-get install without -y

    apt-get asks "Do you want to continue?" and a build can't answer, so the step stops with an error. Write apt-get install -y.

    Read more
  2. Warningline 1node:latest has no fixed version

    Without a tag, or with latest, the next build may pull a different major version than the last one, and a build that worked yesterday can fail today. Name a version, such as node:22-alpine or python:3.12-slim.

    Read more
  3. Warningline 1No EXPOSE in the last stage

    We send traffic to the port in the PORT environment variable (8080) unless the image declares one with EXPOSE. If your app listens on 3000 and reads nothing, it stays on Starting. Add EXPOSE 3000, or make the app read PORT. A bot or worker without an address needs neither.

    Read more
  4. Warningline 4apt-get install without apt-get update in the same RUN

    Base images ship without package lists, or with old ones. Without apt-get update in the same RUN the install fails with "Unable to locate package", or later, when a cached update step is older than the mirrors.

    Read more
  5. Warningline 6API_KEY is set in the Dockerfile

    A value in ENV or ARG is stored in the image and its history, where anyone with the image can read it. Set keys and passwords as environment variables of the app instead; they are stored encrypted.

    Read more
  6. Noteline 1The app runs as root

    Without a USER line the container runs as root. On blitz.cloud that is fine: every app runs in its own gVisor sandbox, so root there is root in that sandbox only. Hosts that refuse root need a USER line.

    Read more
  7. Noteline 3All files copied before the dependencies are installed

    COPY . comes before the install step, so any change to any file installs every dependency again. Copy the manifest first (package.json and its lockfile, requirements.txt, go.mod), install, then copy the rest. Builds get faster, and on the free plan they use fewer build minutes.

    Read more
  8. Noteline 4apt package lists stay in the image

    The lists apt-get update downloads stay in the layer, tens of MB the app never reads. End the same RUN with rm -rf /var/lib/apt/lists/* to keep the image smaller, which also makes it quicker to pull.

    Read more
  9. Noteline 5The image that builds is the image that runs

    One stage compiles the app (npm run build) and also runs it, so compilers, dev dependencies and caches ship with it. A second FROM that copies only the result keeps the running image small.

    Read more
What the check looks for
  • Error The file has a FROM line.
  • Warning Base images name a version, not latest.
  • Error No --platform for arm, since our servers are amd64.
  • Warning The last stage says its port with EXPOSE.
  • Warning The last stage has a start command when its base image has none.
  • Warning RUN starts nothing in the background (&, nohup).
  • Error apt-get install has -y.
  • Warning apt-get update runs in the same RUN as the install.
  • Note apt's package lists are removed after the install.
  • Note pip install runs without its cache.
  • Note Dependencies are installed before the rest of the code is copied.
  • Note A compiled app runs from a second, smaller stage.
  • Warning No keys or passwords in ENV or ARG.
  • Error RUN doesn't call docker.
  • Note Which VOLUME folders become kept folders.
  • Warning At most 6 kept folders.
  • Warning No VOLUME over a folder COPY fills.
  • Note No VOLUME on system folders such as /tmp.
  • Note A non-root user owns the folders it writes to.
  • Note Which user the app runs as.

What the check does and doesn't do

It reads the Dockerfile as text, the way our build reads it before it starts: instructions joined across line breaks, comments dropped, the last stage taken as the image that runs. It doesn't build anything, so it can't tell whether a package exists or your code compiles. It also doesn't know your other files. A finding about a missing EXPOSE may be fine if your app reads PORT.

Each finding is one of three kinds:

  • Error: the build or the start will fail as written.
  • Warning: it often fails, or works today and breaks later.
  • Note: it works, but costs you build time, image size or a surprise later.

Every finding links to the part of our docs that explains it. Most of it is plain Docker and true on any host. Where blitz.cloud does something its own way, like the port it sends traffic to, the folders it keeps or running as root in a sandbox, the finding says so.

Checking a repository

Paste a public GitHub address, such as https://github.com/owner/repo, and the page fetches the Dockerfile from the repository's root through raw.githubusercontent.com, straight from your browser. For a Dockerfile in a subfolder or on another branch, paste the file's address (.../blob/main/api/Dockerfile). Private repositories don't work here. Connect GitHub on blitz.cloud for those.

Put your first app online today.

Start on the free plan, no credit card. Move to Pro when an app has to stay online.

Put your app online