Skip to content

Instantly share code, notes, and snippets.

@nicolabeghin
Created March 30, 2021 18:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolabeghin/68e4b515a8d22e36757facb5a3be58e5 to your computer and use it in GitHub Desktop.
Save nicolabeghin/68e4b515a8d22e36757facb5a3be58e5 to your computer and use it in GitHub Desktop.
Ansible to install docker and docker-compose on AWS Graviton t4a ARM64 instances
---
- name: Docker install
hosts: all
become: yes
tasks:
- name: Install docker-ce (centos) via amazon-linux-extras packages
shell: "amazon-linux-extras install docker -y"
- name: Install dependencies
yum:
name:
- docker
state: latest
- name: Start Docker service
service:
name: docker
state: restarted
enabled: yes
become: yes
- name: Add user ec2-user to docker group
user:
name: ec2-user
groups: docker
append: yes
become: yes
# https://github.com/docker/compose/issues/7472#issuecomment-749993557
# https://stackoverflow.com/a/65612078/2378095
- name: docker-compose install
hosts: all
become: yes
tasks:
- name: Install dependencies
yum:
name:
- python3
- python3-devel
- libffi-devel
- openssl-devel
state: latest
- name: install Development Tools
shell: yum groupinstall -y "Development Tools"
- name: update python pip
shell: python3 -m pip install -U pip
- name: install docker-compose from pip
shell: python3 -m pip install docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment