Install the following packages, which are good to have installed:
sudo dnf install --allowerasing -y dnf-plugins-core \
dnf-utils \
grubby \
audit \
dbus \
polkit \
systemd-container \
nss-util \
nss-tools \
udisks2 \
lvm2 \
dosfstools \
e2fsprogs \
xfsprogs \
xfsprogs-xfs_scrub \
attr \
acl \
nfs4-acl-tools \
nfsv4-client-utils \
cifs-utils \
fuse3 \
gzip \
pigz \
bzip2 \
xz \
zstd \
star \
shadow-utils \
shadow-utils-subid \
numactl \
libseccomp \
iproute-tc \
iptables-nft \
nftables \
conntrack-tools \
ipset \
ethtool \
psutils \
python3 \
python3-pip \
policycoreutils-python-utils \
bash-completion \
vim-minimal \
vim-default-editor \
wget \
git \
jq \
bind-utils \
mtr \
traceroute \
inotify-tools
Install miscellaneous amazon tools:
sudo dnf install --allowerasing -y ec2-utils \
awscli-2 \
ec2-instance-connect \
ec2-instance-connect-selinux \
amazon-ssm-agent \
amazon-cloudwatch-agent \
amazon-efs-utils \
ec2rl
(Optional) Remove the EC2 Hibernation Agent:
sudo dnf remove -y ec2-hibinit-agent
(Optional) Install Ansible:
sudo dnf install -y ansible-core ansible python3-psutil sshpass
Install Moby aka Docker with the following commands:
sudo dnf install --allowerasing -y docker \
containerd \
runc \
container-selinux \
cni-plugins \
oci-add-hooks \
amazon-ecr-credential-helper \
udica
Add the ec2-user
to the docker group:
sudo usermod -aG docker ec2-user
Enable and start the docker service:
sudo systemctl enable --now docker
sudo systemctl status docker
Install the Docker Compose plugin with the following commands:
# Install for all users
sudo mkdir -p /usr/local/lib/docker/cli-plugins
sudo curl -sL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) \
-o /usr/local/lib/docker/cli-plugins/docker-compose
# Set ownership to root and make executable
sudo chown root:root /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
(Optional) To install for the local user, run the following commands:
mkdir -p "$HOME/.docker/cli-plugins"
touch "$HOME/.docker/config.json"
cp /usr/local/lib/docker/cli-plugins/docker-compose "$HOME/.docker/cli-plugins/docker-compose"
touch ~/.{bashrc,bash_profile,bash_login,bash_logout}
cat <<'EOF' | tee -a "${HOME}/.bashrc"
#export DOCKER_CONFIG=/usr/local/lib/docker
export DOCKER_CONFIG="${DOCKER_CONFIG:-$HOME/.docker}"
EOF
Verify the plugin is installed correctly with the following command(s):
docker compose version
docker compose help
(Optional) Install docker scout with the following commands:
(Optional) Install Docker buildx with the following commands:
(Optional) Login to the AWS ECR service:
aws ecr-public get-login-password --region us-east-1 \
| docker login \
--username AWS \
--password-stdin public.ecr.aws
(Optional) To create an AL2023 container:
docker pull public.ecr.aws/amazonlinux/amazonlinux:2023
docker run -it \
--security-opt seccomp=unconfined \
public.ecr.aws/amazonlinux/amazonlinux:2023 /bin/bash
- https://mobyproject.org/
- https://github.com/docker/docker-install
- https://github.com/docker/docker-ce-packaging
- https://download.docker.com/linux/static/stable/
- https://docs.docker.com/compose/install/linux/
- https://github.com/docker/compose/
- https://github.com/docker/docker-credential-helpers
- https://github.com/docker/buildx