-
Notifications
You must be signed in to change notification settings - Fork 3
Hadolint files #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Hadolint files #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||||||||||||||
FROM ubuntu | ||||||||||||||||||
MAINTAINER someone@example.com | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace deprecated
-MAINTAINER someone@example.com
+LABEL maintainer="someone@example.com" 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Hadolint (2.12.0)[error] 2-2: MAINTAINER is deprecated (DL4000) 🤖 Prompt for AI Agents
|
||||||||||||||||||
RUN apt-get update && apt-get install -y python3 pip | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Build will fail:
Proposed fix: -RUN apt-get update && apt-get install -y python3 pip
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends python3 python3-pip && \
+ rm -rf /var/lib/apt/lists/* 🤖 Prompt for AI Agents
|
||||||||||||||||||
COPY . /app | ||||||||||||||||||
WORKDIR /app | ||||||||||||||||||
RUN chmod 777 /app | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion
World-writable permissions are unnecessary and risky. Prefer a dedicated non-root user with narrow permissions. -RUN chmod 777 /app
+# optional: create non-root user and adjust perms
+RUN useradd -ms /bin/bash appuser && \
+ chown -R appuser:appuser /app
+USER appuser 🤖 Prompt for AI Agents
|
||||||||||||||||||
CMD ["python3", "app.py"] | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
Pin the base image for reproducible builds
ubuntu
without a tag drifts over time and may break in CI/CD. Pin a specific LTS tag (e.g.ubuntu:22.04
) or a digest.Pin the base image for reproducible builds
Using an untagged base image drifts over time and can break your CI/CD. Pin the Ubuntu LTS release in
hadolint/Dockerfile
:• hadolint/Dockerfile:1
📝 Committable suggestion
🤖 Prompt for AI Agents