Kubernetes

docker-compose 최신 버전으로 upgrade

아르비스 2022. 1. 4. 11:49

ㅁ Docker-compose upgrade

$ apt install docker-compose or pip3 install docker-compose 시 설치 후  버전을 확인 하면  다음과 같다.

$ docker-compose  -v
docker-compose version 1.17.1, build unknown

 

해당 버전은 range port 지정에 문제가 있어 다음과 같은 에러를 발생한다.

ERROR: Invalid published port: 8051-8053

 

해당 사유로 docker-compose를 최신 버전으로 설치한다.

 

ㅁ 설치 방법

  1. 기존 설치 버전 삭제
    $ sudo apt-get remove docker-compose
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
      golang-docker-credential-helpers libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libsecret-1-0 libsecret-common python python-asn1crypto python-backports.ssl-match-hostname
      python-cached-property python-certifi python-cffi-backend python-chardet python-cryptography python-docker python-dockerpty python-dockerpycreds python-docopt python-enum34 python-funcsigs
      python-functools32 python-idna python-ipaddress python-jsonschema python-minimal python-mock python-openssl python-pbr python-pkg-resources python-requests python-six python-texttable python-urllib3
      python-websocket python-yaml python2.7 python2.7-minimal
    Use 'sudo apt autoremove' to remove them.
    The following packages will be REMOVED:
      docker-compose
    0 upgraded, 0 newly installed, 1 to remove and 43 not upgraded.
    After this operation, 517 kB disk space will be freed.
    Do you want to continue? [Y/n] y​


  2.  jq library 설치
    $ sudo apt install jq
    Reading package lists... Done
    Building dependency tree      
    Reading state information... Done
    jq is already the newest version (1.5+dfsg-2+b1).
    0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.​


  3. 최신 버전 설치
    $ VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
    $ DESTINATION=/usr/bin/docker-compose
    $ sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
    $ sudo chmod 755 $DESTINATION​
  4. 설치 버전 확인
    $ docker-compose -v
    Docker Compose version v2.2.2​