Skip to content

مدقق Dockerfile

افحص ملفات Dockerfile بحثًا عن الأخطاء الشائعة: وسوم latest، وذاكرة apt المؤقتة، والتشغيل كـ root، وADD مقابل COPY، والأسرار في ENV وغيرها. لا يُرفع أي شيء.

بلا رفع
  • ! Line 1 Avoid the :latest tag for "node:latest" — builds will not be reproducible [latest]
  • ! Line 2 MAINTAINER is deprecated — use LABEL maintainer="…" [maintainer]
  • ✕ Line 3 "API_TOKEN" looks like a secret baked into the image — use build secrets (RUN --mount=type=secret) or runtime env [secret]
  • ! Line 4 Run apt-get update and install in the same RUN, or the cached update goes stale [apt-update]
  • ✕ Line 5 apt-get install needs -y in a non-interactive build [apt-y]
  • i Line 5 Add --no-install-recommends to keep the image small [apt-recommends]
  • i Line 5 Clean up with rm -rf /var/lib/apt/lists/* in the same RUN [apt-lists]
  • i Line 5 Consecutive RUN (line 4) — combine with && to reduce layers [layers]
  • i Line 6 Prefer npm ci for reproducible installs from package-lock.json [npm-ci]
  • i Line 6 Use WORKDIR instead of cd [cd]
  • i Line 6 Consecutive RUN (line 5) — combine with && to reduce layers [layers]
  • ! Line 7 Use COPY instead of ADD for local files [add]
  • ! Line 8 Use an absolute WORKDIR path (/app) [workdir]
  • ! Line 9 Piping a download into a shell is risky; also set SHELL ["/bin/bash", "-o", "pipefail", "-c"] so failures are caught [pipe-sh]
  • ✕ Line 10 Invalid port "70000" (1–65535) [port]
  • i Line 11 Use the JSON exec form for CMD (["cmd", "arg"]) so signals reach your process [exec-form]
  • ! Line 12 Multiple CMD instructions — only the last one (line 12) takes effect [multiple]
  • ! Line 12 The container runs as root — add a USER with a non-root account [root]
  • i Line 12 No HEALTHCHECK defined [healthcheck]

كيفية استخدام مدقق Dockerfile

  1. 1افتح مدقق Dockerfile. يعمل في متصفحك دون تسجيل.
  2. 2اكتب بياناتك أو الصقها.
  3. 3انسخ النتيجة أو نزّلها.

أسئلة

Which rules are checked?

Common best practices similar to hadolint: pinned base images, apt/apk/pip cache cleanup, ADD vs COPY, running as root, secrets in ENV/ARG, exec-form CMD, invalid ports, multiple CMDs and more.

Is my Dockerfile uploaded?

No. Linting happens entirely in your browser.

Does it build the image?

No. It reads the Dockerfile text only.

أدوات أخرى