File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 5252 sleep 60
5353 echo "Instance should be ready now"
5454
55+ - name : Install Docker on EC2 instance
56+ uses : appleboy/ssh-action@v1.0.3
57+ with :
58+ host : ${{ steps.terraform.outputs.public_ip }}
59+ username : ${{ vars.AWS_EC2_USER }}
60+ key : ${{ secrets.AWS_EC2_PRIVATE_KEY }}
61+ script : |
62+ # Add Docker's official GPG key
63+ sudo apt-get update
64+ sudo apt-get install -y ca-certificates curl
65+ sudo install -m 0755 -d /etc/apt/keyrings
66+ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
67+ sudo chmod a+r /etc/apt/keyrings/docker.asc
68+
69+ # Add the repository to Apt sources
70+ echo \
71+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
72+ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
73+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
74+
75+ # Install Docker
76+ sudo apt-get update
77+ sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
78+
79+ # Add user to docker group
80+ sudo usermod -a -G docker ${{ vars.AWS_EC2_USER }}
81+
82+ # Apply group changes without logout
83+ newgrp docker
84+
5585 - name : Copy Docker Compose File From Repo to VM Host
5686 uses : appleboy/scp-action@v0.1.7
5787 with :
You can’t perform that action at this time.
0 commit comments