-
CnetOS7(Amazon Linux2) Docker Compose 설치 하기오픈소스 2021. 10. 14. 12:20
테스트 환경
- Amazon EC2
- Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-0e4a9ad2eb120e054테스트 환경은 AWS Amazon Linux 2 AMI 로 생성한 EC2 머신에서 진행되었습니다.
Yum
$ sudo yum install docker
[Output]
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00:00 amzn2extra-docker | 3.0 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package docker.x86_64 0:20.10.7-3.amzn2 will be installed --> Processing Dependency: runc >= 1.0.0 for package: docker-20.10.7-3.amzn2.x86_64 --> Processing Dependency: libcgroup >= 0.40.rc1-5.15 for package: docker-20.10.7-3.amzn2.x86_64 --> Processing Dependency: containerd >= 1.3.2 for package: docker-20.10.7-3.amzn2.x86_64 --> Processing Dependency: pigz for package: docker-20.10.7-3.amzn2.x86_64 --> Running transaction check ---> Package containerd.x86_64 0:1.4.6-3.amzn2 will be installed ---> Package libcgroup.x86_64 0:0.41-21.amzn2 will be installed ---> Package pigz.x86_64 0:2.3.4-1.amzn2.0.1 will be installed ---> Package runc.x86_64 0:1.0.0-2.amzn2 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================================================================================================================================================================================================================================================================= Package Arch Version Repository Size ========================================================================================================================================================================================================================================================================================================================================================================= Installing: docker x86_64 20.10.7-3.amzn2 amzn2extra-docker 42 M Installing for dependencies: containerd x86_64 1.4.6-3.amzn2 amzn2extra-docker 24 M libcgroup x86_64 0.41-21.amzn2 amzn2-core 66 k pigz x86_64 2.3.4-1.amzn2.0.1 amzn2-core 81 k runc x86_64 1.0.0-2.amzn2 amzn2extra-docker 3.3 M Transaction Summary ========================================================================================================================================================================================================================================================================================================================================================================= Install 1 Package (+4 Dependent packages) Total download size: 69 M Installed size: 285 M Is this ok [y/d/N]: y Downloading packages: (1/5): libcgroup-0.41-21.amzn2.x86_64.rpm | 66 kB 00:00:00 (2/5): pigz-2.3.4-1.amzn2.0.1.x86_64.rpm | 81 kB 00:00:00 (3/5): containerd-1.4.6-3.amzn2.x86_64.rpm | 24 MB 00:00:01 (4/5): docker-20.10.7-3.amzn2.x86_64.rpm | 42 MB 00:00:01 (5/5): runc-1.0.0-2.amzn2.x86_64.rpm | 3.3 MB 00:00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 41 MB/s | 69 MB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : runc-1.0.0-2.amzn2.x86_64 1/5 Installing : containerd-1.4.6-3.amzn2.x86_64 2/5 Installing : libcgroup-0.41-21.amzn2.x86_64 3/5 Installing : pigz-2.3.4-1.amzn2.0.1.x86_64 4/5 Installing : docker-20.10.7-3.amzn2.x86_64 5/5 Verifying : docker-20.10.7-3.amzn2.x86_64 1/5 Verifying : containerd-1.4.6-3.amzn2.x86_64 2/5 Verifying : pigz-2.3.4-1.amzn2.0.1.x86_64 3/5 Verifying : runc-1.0.0-2.amzn2.x86_64 4/5 Verifying : libcgroup-0.41-21.amzn2.x86_64 5/5 Installed: docker.x86_64 0:20.10.7-3.amzn2 Dependency Installed: containerd.x86_64 0:1.4.6-3.amzn2 libcgroup.x86_64 0:0.41-21.amzn2 pigz.x86_64 0:2.3.4-1.amzn2.0.1 runc.x86_64 0:1.0.0-2.amzn2 Complete!
2. 도커 컴포즈를 설치합니다.
https://docs.docker.com/compose/install/
OS 탭에서 Linux를 선택합니다.
아래 명령어를 실행합니다.
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
[Output]
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 633 100 633 0 0 2521 0 --:--:-- --:--:-- --:--:-- 2521 100 12.1M 100 12.1M 0 0 12.4M 0 --:--:-- --:--:-- --:--:-- 45.5M
docker-compose에 실행권한을 부여합니다.
$ sudo chmod +x /usr/local/bin/docker-compose
ln 명령어를 사용하여 심볼릭 링크를 생성해 줍니다.
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose 명령어가 잘 실행되는지 확인합니다.
$ docker-compose --version docker-compose version 1.29.2, build 5becea4c
'오픈소스' 카테고리의 다른 글
[Rocky Linux8] 5분 안에 손쉽게 MariaDB 설치 하기 (0) 2023.01.02 [Prometheus] snmp export server returned HTTP status 500 Internal Server Error (0) 2022.04.29 AWS EC2에 Nodejs 설치 (0) 2020.06.01 Netdata를 이용하여 Nvidia GPU 성능 모니터링 하기 (0) 2020.04.01 오픈소스 CMDB 프로그램 Ralph3 설치 (0) 2020.03.27