110.00 a
Description: Just simple Docker compose command and prune things. This article covers simple commands. A script that runs specifically as soon as the infrastructure is up with ec2 userdata.
#100#Infra#110#DevOps_Engineer_Infra#110.00#Docker#110.00 a#Simple_docker_command_things
AWS , yum package manager, Amzon linux 2.
Docker-docker-compose_install.sh
#!/bin/bash
yum install -y docker
systemctl enable docker
systemctl start docker
# sudo를 사용하지 않고도 Docker 명령을 실행할 수 있도록 docker 그룹에 ec2-user 추가
usermod -a -G docker ec2-user
# terminal 재시작 후, 진행
docker info >> /home/ec2-user/log.txt
# docker compose 설치
curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version >> /home/ec2-user/log.txt
# git clone docker-compose.yaml
yum install git -y
cd /home/ec2-user/
git clone https://gitlab.com/sleepknight/docker-compose.git
too_much_overay2_delete.sh
# check disk volume in /var/lib/docker/overlay2
# check command du -sh */diff/ |sort -nr
docker system prune -a -f