Last active
May 26, 2023 19:04
-
-
Save froop/1813d22a16a3df35c917b2647422aa64 to your computer and use it in GitHub Desktop.
[Linux][EC2] Docker環境構築(Amazon Linux 2用)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# Docker環境構築(Amazon Linux 2用) | |
# locale | |
localectl set-locale LANG=ja_JP.UTF-8 | |
# timezone | |
echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock | |
rm -f /etc/localtime | |
ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | |
# swap file | |
dd if=/dev/zero of=/swapfile bs=128M count=8 | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab | |
# docker | |
yum install -y docker | |
systemctl enable docker | |
systemctl start docker | |
usermod -a -G docker ec2-user | |
# docker-compose | |
curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/libexec/docker/cli-plugins/docker-compose | |
chmod +x /usr/libexec/docker/cli-plugins/docker-compose | |
#curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
#chmod +x /usr/local/bin/docker-compose | |
# git | |
yum install -y git | |
yum clean all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
cd /home/ec2-user | |
wget https://gist.github.com/froop/1813d22a16a3df35c917b2647422aa64/raw/configure-docker-amzn2.sh | |
chmod +x configure-docker-amzn2.sh | |
./configure-docker-amzn2.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment