Compose는 다중 컨테이너 Docker 애플리케이션을 정의하고 실행하기 위한 도구로써 Compose에서는 YAML 파일을 사용하여 애플리케이션 서비스를 구성하고 단일 명령으로 구성에서 모든 서비스를 만들고 시작할 수 있도록 한다.
“For alpine
, the following dependency packages are needed: py-pip
, python3-dev
, libffi-dev
, openssl-dev
, gcc
, libc-dev
, rust
, cargo
and make
. “라고 한다. 관련 패키지를 설치한다.
haedong@kubesphere-01:~:]$ sudo yum install python-pip python3-devel libffi-devel openssl-devel gcc libc-devel rust cargo make
...중략...
Verifying : redhat-rpm-config-9.1.0-88.el7.centos.noarch 29/29
Installed:
cargo.x86_64 0:1.53.0-1.el7 libffi-devel.x86_64 0:3.0.13-19.el7 openssl-devel.x86_64 1:1.0.2k-19.el7 python2-pip.noarch 0:8.1.2-14.el7 python3-devel.x86_64 0:3.6.8-17.el7 rust.x86_64 0:1.53.0-1.el7
Dependency Installed:
dwz.x86_64 0:0.11-3.el7 keyutils-libs-devel.x86_64 0:1.5.8-3.el7 krb5-devel.x86_64 0:1.15.1-50.el7 libcom_err-devel.x86_64 0:1.42.9-19.el7 libkadm5.x86_64 0:1.15.1-50.el7 libselinux-devel.x86_64 0:2.5-15.el7
...중략...
Complete!
설치
공식 홈페이지의 가이드는
haedong@kubesphere-01:~:]$ sudo curl -k -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (35) TCP connection reset by peer
이지만…… 왜인지 안된다. 그냥 다운로드 하자.
haedong@kubesphere-01:~:]$ wget --no-check-certificate https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
--2021-08-26 15:52:24-- https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64
Saving to: ‘docker-compose-Linux-x86_64’
100%[=======================================================================================================================================================================================================================================================>] 12,737,304 3.61MB/s in 3.7s
2021-08-26 15:52:29 (3.29 MB/s) - ‘docker-compose-Linux-x86_64’ saved [12737304/12737304]
/usr/local/bin 경로로 파일 이동 후 권한 변경
haedong@kubesphere-01:~:]$ sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
haedong@kubesphere-01:~:]$ sudo chmod +x /usr/local/bin/docker-compose
haedong@kubesphere-01:~:]$ docker-compose
Define and run multi-container applications with Docker.
Usage:
docker-compose [-f <arg>...] [--profile <name>...] [options] [--] [COMMAND] [ARGS...]
docker-compose -h|--help
Options:
...후략
※ /usr/local/bin 디렉토리가 $PATH 에 포함되어있지 않다면 추가 해야 한다. /etc/profile (모든 사용자에 적용) ~/.bash_profile의 $PATH 에 위 경로를 추가하자.
haedong@kubesphere-01:~:]$ sudo echo export PATH=$PATH:/usr/local/bin >> ~/.bash_profile
haedong@kubesphere-01:~:]$ source ~/.bash_profile