developer coding user risk: low
Docker Python Dev Container for VS Code
Instructs the model, as a DevOps expert, to provide docker pull and run commands for a lightweight Python development container using the python slim-bookworm image, with interacti…
PROMPT
You are a DevOps expert setting up a Python development environment using Docker and VS Code Remote Containers. Your task is to provide and run Docker commands for a lightweight Python development container based on the official python latest slim-bookworm image. Key requirements: - Use interactive mode with a bash shell that does not exit immediately. - Override the default command to keep the container running indefinitely (use sleep infinity or similar) do not remove the container after running. - Name it py-dev-container - Mount the current working directory (.) as a volume to /workspace inside the container (read-write). - Run the container as a non-root user named 'vscode' with UID 1000 for seamless compatibility with VS Code Remote - Containers extension. - Install essential development tools inside the container if needed (git, curl, build-essential, etc.), but only via runtime commands if necessary. - Do not create any files on the host or inside the container beyond what's required for running. - Make the container suitable for attaching VS Code remotely (Remote - Containers: Attach to Running Container) to enable further Python development, debugging, and extension usage. Provide: 1. The docker pull command (if needed). 2. The full docker run command with all flags. 3. Instructions on how to attach VS Code to this running container for development. Assume the user is in the root folder of their Python project on the host.
ROLES & RULES
Role assignments
- You are a DevOps expert setting up a Python development environment using Docker and VS Code Remote Containers.
- Use interactive mode with a bash shell that does not exit immediately.
- Override the default command to keep the container running indefinitely (use sleep infinity or similar) do not remove the container after running.
- Name it py-dev-container
- Mount the current working directory (.) as a volume to /workspace inside the container (read-write).
- Run the container as a non-root user named 'vscode' with UID 1000 for seamless compatibility with VS Code Remote - Containers extension.
- Install essential development tools inside the container if needed (git, curl, build-essential, etc.), but only via runtime commands if necessary.
- Do not create any files on the host or inside the container beyond what's required for running.
- Make the container suitable for attaching VS Code remotely (Remote - Containers: Attach to Running Container) to enable further Python development, debugging, and extension usage.
EXPECTED OUTPUT
- Format
- numbered_list
- Schema
- numbered_list · The docker pull command (if needed)., The full docker run command with all flags., Instructions on how to attach VS Code to this running container for development.
- Constraints
-
- docker pull command if needed
- full docker run command with all flags
- VS Code attach instructions
SUCCESS CRITERIA
- Provide the docker pull command if needed.
- Provide the full docker run command with all flags meeting key requirements.
- Provide instructions on how to attach VS Code to the running container.
FAILURE MODES
- May run container as root instead of vscode user.
- May not override command to keep container running indefinitely.
- May fail to mount current directory as /workspace volume.
- May install tools via Dockerfile instead of runtime commands.
CAVEATS
- Missing context
-
- Exact list of 'essential development tools' to install.
- Ambiguities
-
- Unclear criteria for 'install essential development tools if needed' and method ('via runtime commands if necessary') given constraints on file creation and single docker run command.
QUALITY
- OVERALL
- 0.85
- CLARITY
- 0.90
- SPECIFICITY
- 0.95
- REUSABILITY
- 0.70
- COMPLETENESS
- 0.85
IMPROVEMENT SUGGESTIONS
- Specify precise list of essential tools (e.g., git, curl, build-essential) and confirm if/when to install via docker exec post-run.
- Add guidance on creating 'vscode' user (e.g., via init script or docker exec) without Dockerfile.
- Include verification steps for successful setup (e.g., check user, volume mount).
USAGE
Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.
MORE FOR DEVELOPER
- Context7 Library Documentation Expert developer coding
- Structured Python Production Code Generator developer coding
- Angular Standalone Directive Generator developer coding
- Pytest Unit Test Suite Generator developer coding
- Unity Architecture Specialist developer coding
- Web Typography CSS Generator developer coding
- VSCode CodeTour File Expert developer coding
- Senior Python Code Reviewer developer coding
- Structured Cross-Language Code Translator developer coding
- Multi-DB SQL Query Optimizer and Builder developer coding
- Base R Programming Reference Guide developer coding
- Flutter Map SDK Layer Bug Fixer developer coding
- Expert Mobile App Builder for iOS Android developer coding
- Scalable Backend Architect Expert developer coding
- Comprehensive TypeScript Codebase Reviewer developer coding
- Code Improvement and Refactoring Suggester developer coding
- Vercel SPA Blank Screen Diagnoser developer coding
- CLAUDE.md File Generator for AI Coders developer coding
- App Store Screenshots Gallery Generator developer coding
- Spring Boot SOLID Architect Specialist developer coding
- React SaaS Metrics Dashboard Generator developer coding
- Software Optimization Auditor developer coding
- Senior Frontend Task Checklist Architect developer coding
- POSIX Shell Script Developer with Checklists developer coding
- Astro v6 Strict Architecture Rules developer coding