์ด ๊ธ€์€ ์ •๋ฆฌ๋ฅผ ์œ„ํ•ด ๊ฐœ์ธ์ ์ธ ์šฉ๋„๋กœ ์ž‘์„ฑ๋œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ์ง€์ ๊ณผ ์กฐ์–ธ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค ใ…Žใ…Ž

5 minute read

์ด ๊ธ€์€ ์ •๋ฆฌ๋ฅผ ์œ„ํ•ด ๊ฐœ์ธ์ ์ธ ์šฉ๋„๋กœ ์ž‘์„ฑ๋œ ํฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ์ง€์ ๊ณผ ์กฐ์–ธ์€ ์–ธ์ œ๋‚˜ ํ™˜์˜์ž…๋‹ˆ๋‹ค ใ…Žใ…Ž

EC2 ๋น„์šฉ์„ ์ค„์ด๊ธฐ ์œ„ํ•ด t4g ์‹œ๋ฆฌ์ฆˆ์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ์‚ฌ์šฉํ–ˆ๋”๋‹ˆ โ€œGravitonโ€์ด ARM ์•„ํ‚คํ…์ฒ˜๋ž€ ๊ฑธ ๋’ค๋Šฆ๊ฒŒ ๊นจ๋‹ฌ์•˜์Šต๋‹ˆ๋‹ค ๐Ÿ˜ญ x86 ๊ธฐ๋ฐ˜์—์„œ ๊ธฐ์กด์— ์“ฐ๋˜ ์„ค์น˜ ๋ช…๋ น์–ด๋กœ๋Š” ์„ค์น˜๊ฐ€ ์ž˜ ์•ˆ ๋˜๋Š” ๋ฌธ์ œ๋„ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ AWS Graviton์œผ๋กœ ์ธ์Šคํ„ด์Šค๋ฅผ ๊ตฌ์„ฑํ•˜๋ฉด์„œ ๊ฒช์€ ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…์„ ๊ธฐ๋กํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

amazon-linux-extras

Amazon Linux 2์—์„œ๋Š” amazon-linux-extras ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์„œ๋ฒ„๋ฅผ ์šด์˜ํ•˜๋Š”๋ฐ ํ•„์š”ํ•œ ๋„๊ตฌ๋“ค์„ ์‰ฝ๊ฒŒ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค! Amazon Linux๊ฐ€ ์ฒ˜์Œ์ด๋ผ๋ฉด ์š” ๋ช…๋ น์–ด๋ถ€ํ„ฐ ์ตํ˜€์•ผ ํ•ฉ๋‹ˆ๋‹ค! (2023.05 ์—…๋ฐ์ดํŠธ: โ€œAmazon Linux 2023โ€์—๋Š” amazon-linux-extras ๋ช…๋ น์–ด๊ฐ€ ๋น ์กŒ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค stackoverflow ๐Ÿฅฒ ๊ทธ๋ž˜์„œ Amazon Linux 2023์—์„œ๋Š” ์ง์ ‘ yum์œผ๋กœ Docker๋ฅผ ์„ค์น˜ํ•ด์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค!)

$ sudo amazon-linux-extras list
  0  ansible2                 available    [ =2.4.6  =2.8  =stable ]
  1  httpd_modules            available    [ =1.0  =stable ]
  2  memcached1.5             available    \
        [ =1.5.1  =1.5.16  =1.5.17 ]
  5  postgresql10             available    [ =10  =stable ]
  7  R3.4                     available    [ =3.4.3  =stable ]
  8  rust1                    available    [ =stable ]
 14  libreoffice              available    [ =5.3.6.1  =stable ]
 16  docker=latest            enabled      \
        [ =18.06.1  =18.09.9  =stable ]
 17  mate-desktop1.x          available    [ =stable ]
 18  GraphicsMagick1.3        available    \
        [ =1.3.29  =1.3.32  =1.3.34  =stable ]
 19  tomcat8.5                available    \
        [ =8.5.32  =8.5.38  =8.5.40  =8.5.42  =8.5.50  =stable ]
 20  epel                     available    [ =7.11  =stable ]
 21  testing                  available    [ =1.0  =stable ]
 22  ecs                      available    [ =stable ]
 23  corretto8                available    \
        [ =1.8.0_202  =1.8.0_212  =1.8.0_222  =1.8.0_232  =1.8.0_242
          =stable ]
 24  golang1.11               available    \
        [ =1.11.3  =1.11.11  =1.11.13  =stable ]
 25  squid4                   available    [ =4  =stable ]
 27  java-openjdk11           available    [ =11  =stable ]
 28  lynis                    available    [ =stable ]
 30  BCC                      available    [ =0.x  =stable ]
 31  nginx1=latest            enabled      [ =stable ]
 32  ruby2.6=latest           enabled      [ =2.6  =stable ]
 33  mock                     available    [ =stable ]
 34  postgresql11             available    [ =11  =stable ]
 36  python3.8                available    [ =stable ]
 37  lustre2.10               available    [ =stable ]
 38  haproxy2                 available    [ =stable ]
 39  collectd                 available    [ =stable ]
 40  R4                       available    [ =stable ]
  _  kernel-5.4               available    [ =stable ]
 42  selinux-ng               available    [ =stable ]
 43  php8.0                   available    [ =stable ]
 44  tomcat9                  available    [ =stable ]
 45  unbound1.13              available    [ =stable ]
 46  mariadb10.5              available    [ =stable ]
 47  kernel-5.10=latest       enabled      [ =stable ]
 48  redis6                   available    [ =stable ]
 49  ruby3.0                  available    [ =stable ]
 50  postgresql12             available    [ =stable ]
 51  postgresql13             available    [ =stable ]
 52  mock2                    available    [ =stable ]
 53  dnsmasq2.85              available    [ =stable ]
 54  aws-nitro-enclaves-cli   available    [ =stable ]
 55  livepatch                available    [ =stable ]
 56  kernel-5.15              available    [ =stable ]
 57  postgresql14             available    [ =stable ]
 58  firefox                  available    [ =stable ]
 59  lustre                   available    [ =stable ]
 60  php8.1                   available    [ =stable ]
 61  awscli1                  available    [ =stable ]

ruby ์„ค์น˜

# ๋ฃจ๋น„ ์„ค์น˜
sudo amazon-linux-extras list | grep ruby
sudo amazon-linux-extras install ruby2.6

docker ์„ค์น˜

sudo amazon-linux-extras list | grep docker
sudo amazon-linux-extras install docker

sudo usermod -a -G docker ec2-user
sudo setfacl -m user:ec2-user:rw /var/run/docker.sock

์œ„์˜ ๊ณผ์ •์„ ๋ชจ๋‘ ์™„๋ฃŒํ•œ ํ›„์— ํ„ฐ๋ฏธ๋„์„ ๋‹ซ์€ ํ›„ ๋‹ค์‹œ ์ ‘์† ํ•ด์ค๋‹ˆ๋‹ค!

docker-compose ์„ค์น˜

sudo curl \
    -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose

nginx ์„ค์น˜

sudo amazon-linux-extras list | grep nginx
sudo amazon-linux-extras install nginx1

aws-cli ์„ค์น˜

sudo amazon-linux-extras awscli1

Categories: ,

Updated: