Skip to navigation
Simple Docker Debian Basic for Testing
21.04.26
## Simple Docker Debian Basic for Testing This setup provides a minimal, isolated Debian environment that you can easily spin up and access for testing purposes. ### `docker-compose.yml` Create a file named `docker-compose.yml` with the following content: ```yaml version: "3.9" services: basic-debian: image: debian:stable # Use the latest stable Debian image container_name: my-basic-debian # Assign a specific name to the container tty: true # Allocate a pseudo-TTY for interactive sessions stdin_open: true # Keep STDIN open, essential for interactive shells command: bash # The container will run bash upon starting ``` ### How to Use 1. **Save the file:** Save the YAML content above into a file named `docker-compose.yml` in an empty directory on your machine. 2. **Run the container (in detached mode):** Open your terminal, navigate to the directory where you saved `docker-compose.yml`, and run: ```bash docker-compose up -d ``` This command will pull the `debian:stable` image (if you don't have it locally) and start your Debian container in the background. 3. **Enter the container:** To get a bash shell inside your running container, use: ```bash docker exec -it my-basic-debian bash ``` You will now be presented with a root prompt (`root@
:/#`) inside your Debian container. --- This setup is excellent for: * Trying out Debian commands. * Testing scripts or small applications in a clean environment. * Practicing Linux commands without affecting your host system. When you're finished, you can stop and remove the container by running `docker-compose down` in the same directory.
https://salsa.debian.org/users/sign_in
Reply
Anonymous
Information Epoch 1777128261
Effectiveness beats efficiency.
Home
Notebook
Contact us