Skip to content
New issue

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

Docker #2

Open
Strong-Foundation opened this issue Dec 21, 2024 · 1 comment
Open

Docker #2

Strong-Foundation opened this issue Dec 21, 2024 · 1 comment

Comments

@Strong-Foundation
Copy link
Owner

If you don't want to install the SSH server and simply want to start a container, get into it with bash, and keep it running so you can reconnect later, you can do the following:

  1. Pull the Ubuntu Docker image:

    docker pull ubuntu
  2. Run the container in the background with an interactive shell and sleep command to keep it alive:

    docker run -d --name ubuntu-container ubuntu bash -c "sleep infinity"

    This command runs the container in the background (-d), names it ubuntu-container, and starts an interactive Bash shell that runs the sleep infinity command, which keeps the container running indefinitely.

  3. Re-enter the container using docker exec:

    Once the container is running, you can reconnect to it using docker exec:

    docker exec -it ubuntu-container bash

    This will give you access to the Bash shell inside the running container.

Now the container is running and can be accessed with docker exec at any time. The sleep infinity ensures that the container stays running until you explicitly stop it.

Let me know if you need more details!

@Strong-Foundation
Copy link
Owner Author

containers: [
    '^com\\.docker.docker$', // Docker
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant