Skip to content

Instantly share code, notes, and snippets.

@rdeak
Last active July 24, 2024 21:20
Show Gist options
  • Select an option

  • Save rdeak/f49eb093eea9d0c8eea0a309b4ca1a96 to your computer and use it in GitHub Desktop.

Select an option

Save rdeak/f49eb093eea9d0c8eea0a309b4ca1a96 to your computer and use it in GitHub Desktop.
Docker swarm on EC2
#!/bin/sh
set -e
sudo dnf install -y docker
sudo usermod -a -G docker ec2-user
newgrp docker
sudo systemctl start docker
sudo systemctl enable docker
docker swarm init --advertise-addr <public-ip>
# logout in case of error
# to get token for new manager
# docker swarm join-token manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment