No description
install-docker.sh | ||
LICENSE | ||
README.md |
Docker Installation Script for Ubuntu 24.04
A bash script to automate the installation and configuration of Docker on Ubuntu 24.04 (Noble Numbat).
Features
- Complete Docker installation (Docker Engine, Docker CLI, Docker Compose)
- Automatic removal of old Docker versions
- Creates a dedicated Docker user with appropriate permissions
- Configures Docker daemon with sensible defaults
- Includes error handling and installation checkpoints
- Verifies installation with hello-world container
- Sets up Docker to start on boot
Prerequisites
- Ubuntu 24.04 (Noble Numbat)
- Root access or sudo privileges
- Internet connection
Installation
- Clone this repository:
git clone https://git.hhf.technology/hhf/docker-install-ubuntu-2404.git
cd docker-install-ubuntu
- Make the script executable:
chmod +x install-docker.sh
- Run the script:
sudo ./install-docker.sh
What the Script Does
- Removes any conflicting Docker packages
- Installs necessary prerequisites
- Sets up Docker repository and GPG key
- Installs Docker Engine and related tools
- Creates a dedicated Docker user
- Configures Docker daemon
- Verifies the installation
- Enables Docker service on boot
Post-Installation
After installation:
- A new user 'dockeruser' is created and added to the Docker group
- You may need to log out and back in for group changes to take effect
- Docker daemon is configured with log rotation and default network settings
Verification
To verify the installation:
docker --version
docker compose version
docker run hello-world
Configuration
The script creates a default daemon configuration at /etc/docker/daemon.json
with:
- Log rotation (max 3 files of 100MB each)
- Default address pool configuration
- JSON file logging driver
Troubleshooting
- Check the installation logs in
/var/log/docker_install/
- Each step creates a checkpoint file to track progress
- The script can be safely re-run if installation fails
License
Contributing
Feel free to submit issues and pull requests.
Contact
If you have any questions or suggestions, please open an issue in the repository.