We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open your terminal and run:
docker pull ubuntu
Now, run the container in detached mode (-d) and use a command to keep it alive. We'll use sleep to make it sleep indefinitely:
-d
sleep
docker run -d --name my-ubuntu-container ubuntu sleep infinity
Once the container is running, you can access it using:
docker exec -it my-ubuntu-container bash
Pull the Ubuntu image:
Run the container with a sleep command:
Bash into the running container:
To stop the container:
docker stop my-ubuntu-container
To remove the container:
docker rm my-ubuntu-container
That’s it! You should now have a running Ubuntu container that will not crash. Let me know if you have any questions!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Step 1: Pull the Ubuntu Docker Image
Open your terminal and run:
Step 2: Run the Container with a Sleep Command
Now, run the container in detached mode (
-d
) and use a command to keep it alive. We'll usesleep
to make it sleep indefinitely:Step 3: Access the Running Container
Once the container is running, you can access it using:
docker exec -it my-ubuntu-container bash
Summary of Commands
Pull the Ubuntu image:
Run the container with a sleep command:
Bash into the running container:
docker exec -it my-ubuntu-container bash
Optional: Stopping and Removing the Container
To stop the container:
To remove the container:
That’s it! You should now have a running Ubuntu container that will not crash. Let me know if you have any questions!
The text was updated successfully, but these errors were encountered: