Loading...
Loading...
Use when working with ANY Docker task: writing Dockerfiles, configuring docker-compose/compose.yml, multi-stage builds, docker-bake.hcl, container security audits, .dockerignore optimization, or CI/CD container testing. Triggers on: Dockerfile, docker-compose, container, image build, multi-stage, docker bake, compose.
npx skill4agent add netresearch/docker-development-skill docker-developmentFROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
FROM node:20-alpine
RUN addgroup -g 1001 app && adduser -u 1001 -G app -D app
USER app
COPY /app .
HEALTHCHECK \
CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "server.js"]FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /app/server .
FROM gcr.io/distroless/static:nonroot
COPY /app/server /server
CMD ["/server"]RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*COPY package*.json ./
RUN npm ci
COPY . .RUN git clone git@github.com:org/repo.gitENVARGCOPYdocker history--mount=type=secrettarget "app" {
platforms = ["linux/amd64", "linux/arm64"]
cache-from = ["type=gha"]
cache-to = ["type=gha,mode=max"]
}| Anti-pattern | Fix |
|---|---|
| Pin version: |
No | |
| Use specific permissions: |
| Remove or use specific |
| Mount only needed paths |
| Bind to |
| Use |
docker run --rm --entrypoint php myimage -vdocker run --rm --add-host backend:127.0.0.1 nginx-image nginx -tcp .env.example .envdocker compose config.env.example.gitnode_modulesvendor.env**.pem*.keydepends_oncondition: service_healthyhealthcheckstart_periodnetworksinternal: trueprofiles: [debug]--profile debugreferences/ci-testing.md