Skip to content

Commit eb691fe

Browse files
committed
Fix for deploy-ec2.yml
1 parent 0422f2a commit eb691fe

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

.github/workflows/deploy-ec2.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,24 @@ jobs:
7777
set -eu
7878
# Install Docker (Ubuntu official repo for Docker CE; Amazon Linux fallback)
7979
if command -v apt-get >/dev/null 2>&1; then
80+
# Ubuntu path (no gpg; use .asc key file)
8081
export DEBIAN_FRONTEND=noninteractive
8182
apt-get update -y
82-
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
83-
apt-get remove -y "$pkg" || true
84-
done
85-
apt-get install -y ca-certificates curl gnupg unzip
83+
# remove conflicting Ubuntu docker bits (safe if absent)
84+
apt-get remove -y docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc || true
85+
apt-get install -y ca-certificates curl unzip
8686
install -m 0755 -d /etc/apt/keyrings
87-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
88-
chmod a+r /etc/apt/keyrings/docker.gpg
87+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
88+
chmod a+r /etc/apt/keyrings/docker.asc
8989
. /etc/os-release
90-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $VERSION_CODENAME stable" > /etc/apt/sources.list.d/docker.list
90+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $VERSION_CODENAME stable" > /etc/apt/sources.list.d/docker.list
91+
9192
apt-get update -y
9293
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
93-
elif command -v dnf >/dev/null 2>&1; then
94-
dnf -y update || true
95-
dnf -y install docker curl unzip || yum -y install docker curl unzip
96-
elif command -v yum >/dev/null 2>&1; then
97-
yum -y update || true
98-
yum -y install docker curl unzip
99-
else
100-
echo "no supported package manager found"; exit 1
101-
fi
102-
systemctl enable --now docker || true
103-
104-
# ECR login, pull latest, run on 80->8080
94+
systemctl enable --now docker || true
95+
96+
97+
# ECR login, pull latest, run on 80->8080
10598
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
10699
REGION='${AWS_REGION}'
107100
REGISTRY="${ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com"

0 commit comments

Comments
 (0)