This Dockerfile is used to create a Docker image based on Ubuntu 22.04 with additional software and configurations.
- Installs essential packages and dependencies.
- Configures SSH access for the "ubuntu" user.
- Installs MongoDB Mongosh.
- Enables systemd for system-level management.
- Docker: Ensure you have Docker installed on your system.
To build the Docker image, use the following command in the directory containing this Dockerfile:
docker build -t ubuntu-ssh .You can use the provided setup.sh script to build and start the Docker container. This script ensures proper container setup and configuration.
-
Make the script executable:
chmod +x setup.sh
-
Execute the script to build and start the container:
./setup.sh
The script performs the following actions:
- Stops and removes any existing container named "ubuntu-ssh."
- Builds the Docker image using the Dockerfile.
- Runs the Docker container in detached mode with privileged access, allowing systemd to work correctly.
- Maps host port 22 to the container's SSH port.
You can SSH into the running container as the "ubuntu" user with the following command:
ssh ubuntu@localhost -p 22Password: ubuntu
- This Dockerfile is for demonstration purposes and may need further customization for production use.
- Ensure that you use secure SSH keys for authentication in a production environment.
This project is licensed under the GPLv3 License - see the LICENSE file for details.