Last active
December 23, 2021 23:17
-
-
Save froop/3304052725b3f3f2c06a280ea06f8431 to your computer and use it in GitHub Desktop.
[Linux] CentOS 7 + Docker
This file contains 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 | |
# 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 yum-utils | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
yum install -y docker-ce docker-ce-cli containerd.io | |
systemctl enable docker | |
systemctl start docker | |
usermod -a -G docker centos | |
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment