Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sichere ProgrammierungExport annuity schedules to CSV without losing cents(02.10.2026 um 09:27 Uhr)
••
Sichere ProgrammierungIt Quoted the Failure: Two Kinds of False 'Done'(02.10.2026 um 09:30 Uhr)
••
Sichere ProgrammierungBuild a Focus Timer with Vanilla JavaScript — The Pomodoro Technique(02.10.2026 um 09:32 Uhr)
••••
Sichere ProgrammierungHi I'm Yash(02.10.2026 um 09:33 Uhr)
••
Sichere ProgrammierungExport annuity schedules to CSV without losing cents(02.10.2026 um 09:27 Uhr)
••
Sichere ProgrammierungIt Quoted the Failure: Two Kinds of False 'Done'(02.10.2026 um 09:30 Uhr)
••
Sichere ProgrammierungBuild a Focus Timer with Vanilla JavaScript — The Pomodoro Technique(02.10.2026 um 09:32 Uhr)
••••
Sichere ProgrammierungHi I'm Yash(02.10.2026 um 09:33 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Install Docker with Ansible on Ubuntu (Official Repo + Docker Compose)

Hi there! I'm Maneshwar. Right now, I’m building LiveAPI, a first-of-its-kind tool that helps you automatically index API endpoints across all your r…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

Hi there! I'm Maneshwar. Right now, I’m building LiveAPI, a first-of-its-kind tool that helps you automatically index API endpoints across all your repositories. LiveAPI makes it easier to discover, understand, and interact with APIs in large infrastructures.






If you're managing infrastructure with Ansible, installing Docker the right way — using Docker's official apt repository — ensures you're getting the latest stable version.



This post walks you through setting up Docker + Docker Compose on Ubuntu entirely via Ansible.






What This Playbook Does




  • Updates APT cache

  • Installs required dependencies

  • Adds Docker's official GPG key and APT repo

  • Installs Docker CE, CLI, Compose, Buildx, and Containerd

  • Enables and starts the Docker daemon

  • Adds your user (ubuntu) to the docker group so you don’t need sudo for every Docker command






Ansible Playbook: install-docker.yml






---
- name: Install Docker on Ubuntu using official Docker repo
hosts: all
become: true

tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: yes

- name: Ensure dependencies are installed
ansible.builtin.package:
name:
- bc
- curl
- expect
- git
- ca-certificates
state: present

- name: Create Docker GPG key directory
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: "0755"

- name: Download Docker's official GPG key
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.asc
mode: "0644"

- name: Add Docker repository to Apt sources
ansible.builtin.apt_repository:
repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
state: present
filename: docker

- name: Update apt cache after adding Docker repository
ansible.builtin.apt:
update_cache: yes

- name: Install Docker and Docker Compose
ansible.builtin.package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present

- name: Ensure Docker service is enabled and started
ansible.builtin.service:
name: docker
state: started
enabled: yes

- name: Add ubuntu user to docker group
ansible.builtin.user:
name: ubuntu
groups: docker
append: yes









After Running the Playbook



Once this finishes:





  • Logout and log back in to apply the group change.

  • Confirm everything works:




docker --version
docker compose version
docker run hello-world









Why Use This Over apt install docker.io?




  • You get the latest Docker packages direct from Docker Inc.

  • It includes Buildx and Docker Compose v2 (plugin style).

  • Cleaner integration with CI/CD, servers, and dev boxes.






How to Run






ansible-playbook -i inventory install-docker.yml






Use your own inventory/host setup as needed.






LiveAPI helps you get all your backend APIs documented in a few minutes.



With LiveAPI, you can generate interactive API docs that allow users to search and execute endpoints directly from the browser.



LiveAPI Demo



If you're tired of updating Swagger manually or syncing Postman collections, give it a shot.

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

Bedrohungsgraph · ATT&CK-Mapping · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Install Docker with Ansible on Ubuntu (Official Repo + Docker Compose)

Thematisch verwandte Begriffe: Install, Docker, with, Ansible · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag