[ { "id": "sbd-0001", "title": "Python image forgets requirements.txt", "summary": "The Dockerfile installs from requirements.txt before that file exists inside the build context layer.", "failure_type": "missing_build_context_file", "ecosystem": "python", "difficulty": "easy", "tags": [ "dockerfile", "python", "build-context", "pip" ], "files": [ { "path": "Dockerfile", "content": [ "FROM python:3.12-slim", "WORKDIR /app", "COPY app.py .", "RUN pip install --no-cache-dir -r requirements.txt", "CMD [\"python\", \"app.py\"]" ] }, { "path": "requirements.txt", "content": [ "flask==3.0.3" ] }, { "path": "app.py", "content": [ "from flask import Flask", "", "app = Flask(__name__)", "", "@app.get(\"/\")", "def home():", " return {\"status\": \"ok\"}", "", "if __name__ == \"__main__\":", " app.run(host=\"0.0.0.0\", port=8080)" ] } ], "failure_log": [ "Step 4/5 : RUN pip install --no-cache-dir -r requirements.txt", "ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'" ], "build": { "command": "docker build -t sabnock/sbd-0001 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0001 ." ] }, "oracle_patch": [ "diff --git a/Dockerfile b/Dockerfile", "--- a/Dockerfile", "+++ b/Dockerfile", "@@ -1,5 +1,6 @@", " FROM python:3.12-slim", " WORKDIR /app", "-COPY app.py .", "+COPY requirements.txt .", " RUN pip install --no-cache-dir -r requirements.txt", "+COPY app.py .", " CMD [\"python\", \"app.py\"]" ], "scoring": { "must_touch": [ "Dockerfile" ], "must_contain": [ { "path": "Dockerfile", "text": "COPY requirements.txt ." } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0002", "title": "Node image uses npm ci without a lockfile", "summary": "The project has only package.json, but the Dockerfile uses npm ci, which requires a package-lock.json or npm-shrinkwrap.json.", "failure_type": "lockfile_missing", "ecosystem": "node", "difficulty": "easy", "tags": [ "dockerfile", "node", "npm", "lockfile" ], "files": [ { "path": "Dockerfile", "content": [ "FROM node:22-alpine", "WORKDIR /app", "COPY package.json .", "RUN npm ci --omit=dev", "COPY index.js .", "CMD [\"node\", \"index.js\"]" ] }, { "path": "package.json", "content": [ "{\"scripts\":{\"start\":\"node index.js\"},\"dependencies\":{\"express\":\"4.19.2\"}}" ] }, { "path": "index.js", "content": [ "const express = require('express');", "const app = express();", "app.get('/', (_req, res) => res.json({status: 'ok'}));", "app.listen(3000, '0.0.0.0');" ] } ], "failure_log": [ "npm ERR! code EUSAGE", "npm ERR! The `npm ci` command can only install with an existing package-lock.json or npm-shrinkwrap.json." ], "build": { "command": "docker build -t sabnock/sbd-0002 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0002 ." ] }, "oracle_patch": [ "diff --git a/Dockerfile b/Dockerfile", "--- a/Dockerfile", "+++ b/Dockerfile", "@@ -1,6 +1,6 @@", " FROM node:22-alpine", " WORKDIR /app", " COPY package.json .", "-RUN npm ci --omit=dev", "+RUN npm install --omit=dev", " COPY index.js .", " CMD [\"node\", \"index.js\"]" ], "scoring": { "must_touch": [ "Dockerfile" ], "must_contain": [ { "path": "Dockerfile", "text": "RUN npm install --omit=dev" } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0003", "title": "Go multi-stage build copies the wrong binary", "summary": "The builder stage writes /out/server, but the runtime stage tries to copy and execute /out/api.", "failure_type": "multistage_artifact_mismatch", "ecosystem": "go", "difficulty": "easy", "tags": [ "dockerfile", "go", "multi-stage", "copy" ], "files": [ { "path": "Dockerfile", "content": [ "FROM golang:1.23-alpine AS build", "WORKDIR /src", "COPY go.mod ./", "COPY main.go ./", "RUN go build -o /out/server ./...", "FROM alpine:3.20", "COPY --from=build /out/api /usr/local/bin/api", "CMD [\"api\"]" ] }, { "path": "go.mod", "content": [ "module example.com/sabnock/sbd0003", "", "go 1.23" ] }, { "path": "main.go", "content": [ "package main", "", "import \"fmt\"", "", "func main() {", " fmt.Println(\"ok\")", "}" ] } ], "failure_log": [ "failed to solve: failed to compute cache key: failed to calculate checksum of ref: \"/out/api\": not found" ], "build": { "command": "docker build -t sabnock/sbd-0003 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0003 ." ] }, "oracle_patch": [ "diff --git a/Dockerfile b/Dockerfile", "--- a/Dockerfile", "+++ b/Dockerfile", "@@ -3,6 +3,6 @@", " COPY go.mod ./", " COPY main.go ./", " RUN go build -o /out/server ./...", " FROM alpine:3.20", "-COPY --from=build /out/api /usr/local/bin/api", "-CMD [\"api\"]", "+COPY --from=build /out/server /usr/local/bin/server", "+CMD [\"server\"]" ], "scoring": { "must_touch": [ "Dockerfile" ], "must_contain": [ { "path": "Dockerfile", "text": "/out/server /usr/local/bin/server" }, { "path": "Dockerfile", "text": "CMD [\"server\"]" } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0004", "title": "Compose API starts before Postgres is ready", "summary": "depends_on only controls startup order. The API starts while Postgres is still initializing, so integration tests see connection refused.", "failure_type": "compose_readiness", "ecosystem": "compose", "difficulty": "medium", "tags": [ "compose", "postgres", "healthcheck", "integration-test" ], "files": [ { "path": "docker-compose.yml", "content": [ "services:", " api:", " build: .", " environment:", " DATABASE_URL: postgres://postgres:postgres@db:5432/postgres", " depends_on:", " - db", " db:", " image: postgres:16-alpine", " environment:", " POSTGRES_PASSWORD: postgres" ] }, { "path": "Dockerfile", "content": [ "FROM python:3.12-slim", "WORKDIR /app", "COPY app.py .", "CMD [\"python\", \"app.py\"]" ] }, { "path": "app.py", "content": [ "import os", "print(os.environ['DATABASE_URL'])" ] } ], "failure_log": [ "api-1 | psycopg.OperationalError: connection failed: Connection refused", "db-1 | database system is ready to accept connections" ], "build": { "command": "docker compose up --build --abort-on-container-exit" }, "verify": { "commands": [ "docker compose config --quiet" ] }, "oracle_patch": [ "diff --git a/docker-compose.yml b/docker-compose.yml", "--- a/docker-compose.yml", "+++ b/docker-compose.yml", "@@ -1,11 +1,16 @@", " services:", " api:", " build: .", " environment:", " DATABASE_URL: postgres://postgres:postgres@db:5432/postgres", " depends_on:", "- - db", "+ db:", "+ condition: service_healthy", " db:", " image: postgres:16-alpine", " environment:", " POSTGRES_PASSWORD: postgres", "+ healthcheck:", "+ test: [\"CMD-SHELL\", \"pg_isready -U postgres\"]", "+ interval: 2s", "+ timeout: 3s", "+ retries: 20" ], "scoring": { "must_touch": [ "docker-compose.yml" ], "must_contain": [ { "path": "docker-compose.yml", "text": "condition: service_healthy" }, { "path": "docker-compose.yml", "text": "pg_isready -U postgres" } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0005", "title": ".dockerignore excludes the production dist directory", "summary": "The image is supposed to serve an already-built static site, but .dockerignore removes dist from the build context.", "failure_type": "dockerignore_artifact_excluded", "ecosystem": "frontend", "difficulty": "easy", "tags": [ "dockerfile", "dockerignore", "nginx", "static-site" ], "files": [ { "path": "Dockerfile", "content": [ "FROM nginx:1.27-alpine", "COPY dist/ /usr/share/nginx/html/" ] }, { "path": ".dockerignore", "content": [ "node_modules", "dist" ] }, { "path": "dist/index.html", "content": [ "", "
ok" ] } ], "failure_log": [ "failed to compute cache key: failed to calculate checksum of ref: \"/dist\": not found" ], "build": { "command": "docker build -t sabnock/sbd-0005 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0005 ." ] }, "oracle_patch": [ "diff --git a/.dockerignore b/.dockerignore", "--- a/.dockerignore", "+++ b/.dockerignore", "@@ -1,2 +1 @@", " node_modules", "-dist" ], "scoring": { "must_touch": [ ".dockerignore" ], "must_contain": [], "must_not_contain": [ { "path": ".dockerignore", "text": "dist" } ] }, "split": "seed" }, { "id": "sbd-0006", "title": "Rust Alpine build misses OpenSSL native packages", "summary": "The crate depends on openssl, but the Alpine builder does not install the native headers and pkg-config needed by openssl-sys.", "failure_type": "native_dependency_missing", "ecosystem": "rust", "difficulty": "medium", "tags": [ "dockerfile", "rust", "alpine", "openssl", "native-deps" ], "files": [ { "path": "Dockerfile", "content": [ "FROM rust:1.79-alpine AS build", "WORKDIR /src", "COPY Cargo.toml .", "RUN cargo fetch", "COPY src ./src", "RUN cargo build --release" ] }, { "path": "Cargo.toml", "content": [ "[package]", "name = \"sbd0006\"", "version = \"0.1.0\"", "edition = \"2021\"", "", "[dependencies]", "openssl = \"0.10\"" ] }, { "path": "src/main.rs", "content": [ "fn main() {", " println!(\"ok\");", "}" ] } ], "failure_log": [ "error: failed to run custom build command for `openssl-sys`", "Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge." ], "build": { "command": "docker build -t sabnock/sbd-0006 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0006 ." ] }, "oracle_patch": [ "diff --git a/Dockerfile b/Dockerfile", "--- a/Dockerfile", "+++ b/Dockerfile", "@@ -1,6 +1,7 @@", " FROM rust:1.79-alpine AS build", " WORKDIR /src", "+RUN apk add --no-cache musl-dev pkgconfig openssl-dev", " COPY Cargo.toml .", " RUN cargo fetch", " COPY src ./src", " RUN cargo build --release" ], "scoring": { "must_touch": [ "Dockerfile" ], "must_contain": [ { "path": "Dockerfile", "text": "apk add --no-cache musl-dev pkgconfig openssl-dev" } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0007", "title": "Python src layout is not importable in the container", "summary": "The app lives under src/app, but the container runs python -m app without adding /app/src to PYTHONPATH.", "failure_type": "python_src_layout_import", "ecosystem": "python", "difficulty": "easy", "tags": [ "dockerfile", "python", "src-layout", "runtime" ], "files": [ { "path": "Dockerfile", "content": [ "FROM python:3.12-slim", "WORKDIR /app", "COPY requirements.txt .", "RUN pip install --no-cache-dir -r requirements.txt", "COPY src ./src", "CMD [\"python\", \"-m\", \"app\"]" ] }, { "path": "requirements.txt", "content": [] }, { "path": "src/app/__main__.py", "content": [ "print(\"ok\")" ] } ], "failure_log": [ "/usr/local/bin/python: No module named app" ], "build": { "command": "docker build -t sabnock/sbd-0007 ." }, "verify": { "commands": [ "docker build -t sabnock/sbd-0007 .", "docker run --rm sabnock/sbd-0007" ] }, "oracle_patch": [ "diff --git a/Dockerfile b/Dockerfile", "--- a/Dockerfile", "+++ b/Dockerfile", "@@ -3,4 +3,5 @@", " COPY requirements.txt .", " RUN pip install --no-cache-dir -r requirements.txt", " COPY src ./src", "+ENV PYTHONPATH=/app/src", " CMD [\"python\", \"-m\", \"app\"]" ], "scoring": { "must_touch": [ "Dockerfile" ], "must_contain": [ { "path": "Dockerfile", "text": "ENV PYTHONPATH=/app/src" } ], "must_not_contain": [] }, "split": "seed" }, { "id": "sbd-0008", "title": "Poetry install tries to install the app before source files exist", "summary": "The Dockerfile copies only pyproject.toml, then runs poetry install. Poetry attempts to install the root project and fails because package metadata/source files are not present yet.", "failure_type": "poetry_root_install_order", "ecosystem": "python", "difficulty": "medium", "tags": [ "dockerfile", "python", "poetry", "dependency-install" ], "files": [ { "path": "Dockerfile", "content": [ "FROM python:3.12-slim", "WORKDIR /app", "RUN pip install --no-cache-dir poetry==1.8.3", "COPY pyproject.toml ./", "RUN poetry install --only main", "COPY service ./service", "CMD [\"poetry\", \"run\", \"python\", \"-m\", \"service\"]" ] }, { "path": "pyproject.toml", "content": [ "[tool.poetry]", "name = \"sbd0008\"", "version = \"0.1.0\"", "description = \"synthetic task\"", "authors = [\"Sabnock