adding-docker
Dockerize an application with a production-ready Dockerfile, docker-compose setup, and .dockerignore.
How do I install this agent skill?
npx skills add https://github.com/revitalb-port/skills-registry-demo --skill adding-dockerIs this agent skill safe to install?
- Gen Agent Trust Hubwarn
The skill provides templates and scripts for dockerizing applications. It includes a shell script for building and running containers that is vulnerable to command injection through its arguments. Additionally, the skill's environment detection logic creates a surface for indirect prompt injection from project configuration files.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Add Docker
Use this skill when the user asks to dockerize, containerize, or add Docker support to an application.
Steps
-
Detect the runtime — inspect
package.json,requirements.txt,go.mod,Cargo.toml, etc. to determine the language and runtime. -
Create a multi-stage
DockerfileFor Node.js (example):
FROM node:20-alpine AS base FROM base AS deps WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci --omit=dev FROM base AS build WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npm run build FROM base AS runner WORKDIR /app ENV NODE_ENV=production COPY --from=deps /app/node_modules ./node_modules COPY --from=build /app/.next ./.next COPY --from=build /app/public ./public COPY --from=build /app/package.json ./ EXPOSE 3000 CMD ["npm", "start"]Adapt for the detected framework — adjust the build output directory, entry command, and base image.
-
Create
.dockerignorenode_modules .next .git .env* *.md -
Create
docker-compose.yml(if the app has dependencies like a database or Redis):services: app: build: . ports: - "3000:3000" env_file: .env depends_on: - db db: image: postgres:16-alpine environment: POSTGRES_DB: app POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - pgdata:/var/lib/postgresql/data volumes: pgdata: -
Add npm scripts (optional)
{ "docker:build": "docker build -t myapp .", "docker:run": "docker compose up" }
Notes
- Use Alpine-based images to minimize image size.
- Never copy
.envfiles into the image — useenv_fileor runtime injection. - For monorepos, use a
.dockerignorethat excludes sibling packages not needed by the target app. - Add a
HEALTHCHECKinstruction for production deployments.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/revitalb-port/skills-registry-demo/adding-docker">View adding-docker on skillZs</a>