Skip to content

Narehood/Docker-Prep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐳 Docker-Prep

License Last Commit Bash

Stars Forks Issues

Automated Docker Environment Configuration for Linux

Detects your OS, installs the official Docker Engine, creates dedicated users with correct permissions,
and optionally deploys Portainer for immediate container management.

FeaturesQuick StartCapabilitiesVM-SetupNotes


🐧 Supported Distributions

Ubuntu Debian Alpine Arch Fedora RHEL SUSE

⚡ Quick Start

git clone https://github.com/Narehood/Docker-Prep
cd Docker-Prep
bash install.sh

🚀 Features

Feature Description
Auto-Detection Identifies your distro and installs the correct Docker Engine package
User Management Creates a dedicated Docker user or configures existing users for rootless access
Permission Fix Automatically handles group assignments (usermod -aG docker)
Portainer Ready Option to instantly deploy Portainer via the script
Checksum Gate Verifies Scripts/*.sh against Scripts/.checksums.sha256 before execution
Secure Defaults Ensures proper service enabling and user permission handling

📋 Capabilities

The script guides you through a simplified menu to perform the following:

Action Description
Install Docker Engine Downloads the official installer to a temp file, then runs it (never curl | sh)
User Configuration Creates a new user specifically for Docker or adds your current user
Security Groups Adds the selected user to the docker group for non-root command execution
Portainer Deployment Pulls and runs Portainer CE pinned to a verified image digest from the LTS release channel on port 9443

🔗 VM-Setup Integration

VM-Setup launches Docker-Prep from a pinned revision in a temporary checkout.

Variable Purpose
DOCKER_PREP_EPHEMERAL=1 Marks the launch as temporary; disables self-update
DOCKER_PREP_REVISION=<sha> Displays the pinned commit in the UI

Example:

DOCKER_PREP_EPHEMERAL=1 DOCKER_PREP_REVISION=<full-sha> bash ./install.sh

VM-Setup syncs its pin when this repository publishes a GitHub Release.

Publishing a release

  1. Bump VERSION in install.sh (for example 2.4.0).
  2. Commit the change.
  3. Tag and push: git tag v2.4.0 && git push origin v2.4.0
  4. The Release workflow creates the GitHub Release and, when VM_SETUP_DISPATCH_TOKEN is configured, notifies VM-Setup via repository_dispatch (docker-prep-release).

🔒 Integrity tooling

Regenerate the trusted checksum manifest after changing any file under Scripts/:

bash tools/generate-checksums.sh

Local validation (matches CI):

bash tests/security-checks.sh
shellcheck --severity=error install.sh Scripts/*.sh tests/*.sh tools/*.sh

⚠️ Important Notes

Note Details
Root Access Script must be run as root or with sudo privileges
Re-Login Required Log out and back in after adding a user to the Docker group
Portainer If installed, accessible at https://<your-ip>:9443
Ephemeral launches When launched from VM-Setup, update the pin there instead of using menu self-update

Licensed under the MIT License.
You are free to use and modify this script as you wish.

About

This is a basic script to either install docker, create a user called Docker, or add any user to the Docker group. Meant to be ran from the VM-Setup Script. Repo: https://github.com/Narehood/VM-Setup

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages