Aller au contenu principal
PromptDailyDes prompts IA sélectionnés et vérifiés chaque jour
Développement

Créer un Dev Container Python

Create Python Dev Container

Fournit et exécute les commandes Docker pour créer un conteneur basé sur l’image officielle Python slim-bookworm, avec bash, l’utilisateur non root vscode et le répertoire courant monté. Utilisez-le pour vous connecter avec VS Code Remote - Containers et développer, déboguer ou étendre un projet Python.

Testé avec:
GPT-4o
Efficacité:
90/100
Archives des prompts

Version en Français

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.

Complétez et lancez

S’ouvre dans un nouvel onglet avec le prompt déjà saisi. Vous devrez peut-être être connecté.

Comment utiliser ce prompt

  • Remplacez tout ce qui figure entre crochets par vos propres informations avant d’envoyer.
  • Les résultats varient selon le modèle. Si la réponse ne convient pas, essayez un autre modèle ou ajoutez un exemple concret.
  • Envoyez le prompt en un seul message. Le découper affaiblit les instructions.

🛍️AI 프롬프트 & 업무 생산성 추천 핫딜

토스쇼핑 엄선 데스크 셋업 & 집중력 케어 10% 적립

토스 10% 적립

※ 본 추천은 토스쇼핑 쉐어링크 제휴 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받을 수 있습니다.

Prompts Développement