Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Doffline

Interactive Docker package downloader and installer for Linux distributions supported by Docker's official repository.

doffline.sh reads Docker's official Linux package index, finds the latest package versions, compares them with locally installed versions, downloads selected packages, and configures Docker automatically.

Supported Distributions

Type Distributions Format Navigation
Debian-based ubuntu, debian, raspbian .deb release → channel → architecture
RPM-based centos, fedora, rhel, rocky, alma, oracle, sles .rpm release → architecture → channel
Static binaries static .tgz channel → architecture

The script detects the repository layout automatically after you choose a distribution.

Features

  • Interactive distribution, release, channel, and architecture selection
  • Live package discovery from Docker's official repository
  • Latest Debian package version detection
  • Installed versus recommended version comparison
  • Color-coded package status:
    • Green: installed version is current or newer
    • Red: package is outdated or not installed
  • Individual or batch package downloads
  • Automatic SHA-256 checksum generation
  • Download manifest generation
  • Automatic package installation with apt-get
  • Docker service enablement and startup
  • Automatic docker group creation and user configuration
  • Docker daemon and non-root access verification
  • Automatic fallback from curl to wget
  • Detailed installation log and failure reporting

Recommended Packages

The default package set contains:

  • containerd.io
  • docker-ce
  • docker-ce-cli
  • docker-buildx-plugin
  • docker-compose-plugin

You can also display and select every package family available in the chosen repository path.

Installation

Clone the repository:

git clone https://github.com/0xamirreza/Doffline.git
cd Doffline
chmod +x doffline.sh

Run the script as a normal user:

./doffline.sh

Do not run the complete script with sudo. It requests administrator privileges only when installation and system configuration are required.

Example Selection

For Ubuntu 22.04 on an AMD64 system, select:

ubuntu -> jammy -> stable -> amd64

For Fedora 42 on an AMD64 system, select:

fedora -> 42 -> x86_64 -> stable

For static binaries on AMD64, select:

static -> stable -> x86_64

The package table looks similar to:

Latest available package versions
#    Package                          Installed version      Recommended version    Date
---- -------------------------------- ---------------------- ---------------------- ------------
1    containerd.io                    Not installed          2.2.6-1                2026-07-10
2    docker-ce                        Not installed          29.6.2-1               2026-07-16
3    docker-ce-cli                    Not installed          29.6.2-1               2026-07-16
4    docker-buildx-plugin             Not installed          0.35.0-1               2026-06-24
5    docker-compose-plugin            Not installed          5.3.1-1                2026-07-07

Enter a to download all displayed packages or enter package numbers separated by spaces:

Selection: 1 2 3

Output

Downloaded files are stored beside the script in a directory named with the current date:

2026-07-21/

The directory contains:

2026-07-21/
|-- containerd.io_..._amd64.deb
|-- docker-buildx-plugin_..._amd64.deb
|-- docker-ce-cli_..._amd64.deb
|-- docker-ce_..._amd64.deb
|-- docker-compose-plugin_..._amd64.deb
|-- install.log
|-- manifest.tsv
`-- SHA256SUMS

RPM downloads use the same layout with .rpm files. Static downloads store .tgz archives in the same date directory.

Running the script again on the same day reuses the same date directory.

Automatic Installation

After all selected packages download successfully, the script automatically:

  1. Requests administrator authentication with sudo
  2. Installs the downloaded packages with apt-get, dnf/yum, or extracts static binaries
  3. Creates the docker group if necessary
  4. Adds the current user to the docker group
  5. Enables and starts the Docker service
  6. Verifies the Docker daemon
  7. Verifies Docker access through the docker group

Full installation output is written to:

YYYY-MM-DD/install.log

After a successful installation, open a new login session or activate the group in the current terminal:

newgrp docker

Verify non-root Docker access:

docker version
docker run --rm hello-world

Requirements

  • Linux
  • Bash 4 or newer
  • curl or wget
  • dpkg and dpkg-query for .deb status checks and installation on Debian-based systems
  • rpm, dnf, or yum for .rpm status checks and installation on RPM-based systems
  • sudo
  • apt-get for automatic .deb installation
  • dnf, yum, or rpm for automatic .rpm installation
  • systemctl or service
  • sha256sum or shasum
  • sg for immediate group-access verification

Automatic package installation supports:

  • Debian-based systems through apt-get
  • RPM-based systems through dnf, yum, or rpm
  • Static binaries through extraction to /usr/local/bin and optional systemd unit creation

Static installs do not include containerd packages from the repository; use .deb or .rpm packages when you need the full engine stack with package-manager dependencies.

Offline Usage Note

The selected Docker packages are saved locally and can be transferred to another compatible system.

However, package-manager installs may download missing operating-system dependencies from configured repositories. For a fully disconnected installation, download all required dependency packages separately before moving the directory to the offline machine.

The target system must also match the selected:

  • Distribution
  • Release or codename
  • CPU architecture

The script blocks automatic installation when the selected package architecture does not match the current system architecture.

Environment Variables

Custom Repository URL

Override Docker's default Linux repository:

DOFFLINE_BASE_URL="https://download.docker.com/linux" ./doffline.sh

Custom User-Agent

Override the HTTP User-Agent if a proxy or CDN rejects the default request:

DOFFLINE_USER_AGENT="Mozilla/5.0" ./doffline.sh

The script uses HTTP/1.1 and automatically tries wget if curl fails.

Troubleshooting

HTTP 403

The script automatically uses a browser-compatible User-Agent and falls back to wget. If both clients fail, check:

  • Proxy or VPN rules
  • Firewall restrictions
  • DNS configuration
  • System date and time
  • Direct access to download.docker.com

Docker Works Only With sudo

Open a new login session or run:

newgrp docker

Then verify:

docker info

Installation Failure

Review the terminal error and the generated log:

cat YYYY-MM-DD/install.log

Downloaded packages and successful partial downloads remain in the date directory.

Check Download Integrity

From inside the output directory:

sha256sum --check SHA256SUMS

Security Warning

Membership in the docker group grants root-equivalent access through the Docker daemon. Add only trusted users to this group.

Help

./doffline.sh --help

Maintainer

Amirreza Sedighi A.K.A. 0XV

Repository: https://github.com/0xamirreza/Doffline

About

Docker Installation From Source (Offlane Mode)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages