우분투에 도커 설치

우분투에 도커 설치



내용의 테이블


  • Introduction
  • Steps to Install Docker Explained
  • Installation as Shell Script
  • Docker run output of Hello World Container
  • Bibliography

  • 소개


  • 이 문서
  • 에서 Ubuntu에 도커를 설치하는 방법을 살펴보겠습니다.
  • 이 자습서의 목적은 Ubuntu
  • 에서 Docker 설치 및 확인에 중점을 둔 포괄적인 단계를 제공하는 것입니다.
  • 이 블로그는 dev.to
  • 에 게시된 동일한 블로그를 다시 게시한 것입니다.

    Docker 설치 단계 설명


  • 저장소 설정
  • apt가 HTTPS를 통해 저장소를 사용할 수 있도록 apt 패키지 색인을 업데이트하고 패키지를 설치합니다.

  • sudo apt-get update
    sudo apt-get remove docker docker-engine docker.io containerd runc
    sudo apt-get install  apt-transport-https ca-certificates curl     gnupg-agent software-properties-common
    


  • Docker의 공식 GPG 키를 추가합니다.

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



    # Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.
    
    sudo apt-key fingerprint 0EBFCD88
    


  • 안정적인 저장소 설정:

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


  • Docker 엔진 설치

  • # Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
    


  • Docker 엔진 설치 확인

  • # Verify Docker Is installed correctly by running the hello-world image.
    sudo docker run hello-world
    


    쉘 스크립트로 설치




    # SET UP THE REPOSITORY
    # Update the apt package index and install packages to allow apt to use a repository over HTTPS:
    sudo apt-get update -y 
    sudo apt-get remove -y docker docker-engine docker.io containerd runc
    sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    
    # Add Docker’s official GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    # Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88, 
    # by searching for the last 8 characters of the fingerprint.
    sudo apt-key fingerprint 0EBFCD88
    
    # Use the following command to set up the stable repository. 
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"
    
    # Update the apt package index, and install the latest version of Docker Engine and containerd, 
    # or go to the next step to install a specific version:
    sudo apt-get update -y
    sudo apt-get install -y docker-ce docker-ce-cli containerd.io
    
    # Verify that Docker Engine is installed correctly by running the hello-world image.
    sudo docker run hello-world
    


  • My Chefgs GitHub에서 사용 가능한 스크립트 소스

  • Hello World의 Docker 실행 출력




    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    


    서지



    이 문서는 Docker installation documentation에서 영감을 받았습니다.
    문제: 소켓 권한이 거부되었습니다. Resolution

    좋은 웹페이지 즐겨찾기