1 분 소요

Ubuntu에 Docker 설치

갑자기 너무 뜬금 없는 이야기일 수도 있다. 우분투에 도커 설치라니? "sudo apt-get install docker" 명령어 한 줄이면 되는 것 아닌가? 라고 생각하고 호기롭게 입력했으나. 되지 않았다.

그냥 생각보다 과정이 복잡했고, 본 게시물을 통해 데비안 패키지 매니저에 대해 좀 더 알게 될 기회라 생각해 작성하게 되었다.

Ubuntu에 Docker 설치 무작정 따라하기

1. sudo apt-get update

img

2. sudo apt-get upgrade

img

3. sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

img

4. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

img

5. sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

img

6. sudo apt-get update

img

6. sudo apt-get install docker-ce docker-ce-cli containerd.io

img

7. sudo systemctl status docker

img

8. sudo docker run hello-world

img

debian apt에 대해서

  • APT: AParTment는 농담이고
  • APT: Advanced Packaging Tool
  • 데비안 계열 리눅스 패키지 관리 매니저
  • 참고로 페도라 계열의 경우 yum, rpm을 사용

apt의 장점

  • 소프트웨어간 의존성 자동 해결
  • 시스템 패키지 자동 조작

apt install의 간략한 원리

  1. 레포지토리 탐색
  2. 찾은 패키지 설치
  • 이때, 기본 레포지토리에 없는 패키지의 경우 레포지토리 추가를 통해서 해결 가능

apt 명령어

  • 패키지 설치
    sudo apt-get install 패키지_이름
    
  • 패키지 제거
    sudo apt-get remove 패키지_이름
    
  • 패키지 검색
    apt-cache search 패키지_이름
    
  • 레포지토리 추가
    sudo apt-get add-apt-repository "레포지토리 링크"
    
  • 패키지 목록 갱신
    sudo apt-get update
    
  • 설치된 패키지 업데이트
    sudo apt-get upgrade
    

참고문헌

댓글남기기