Free Lines Arrow
본문 바로가기
Development/Docker

[Docker] Docker 설치하기

by skahn1215 2021. 7. 22.
728x90
반응형

Docker 설치하기

docker 를 설치해보자

 

window 나 mac 은 아래 사이트를 참조하면 된다.

https://docs.docker.com/engine/install/

 

Install Docker Engine

 

docs.docker.com

 

우분투 16.04.5 에서는 따라 해보니 잘 안돼서 구글링 좀 해보았다.

 

Install using the repository

1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

 sudo apt-get update
 sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

2. Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

3. Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.

 echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

Install Docker Engine

1. 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

 

2. To install a specific version of Docker Engine, list the available versions in the repo, then select and install:

a. List the versions available in your repo:

 apt-cache madison docker-ce

 

b. Install a specific version using the version string from the second column, for example, 5:18.09.1~3-0~ubuntu-xenial.

 sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

 

난 여기서 막혔다 아무리 버전 정보를 넣어 줘도 문제가 생겼다.

구글링을 통해 다음과 같이 했다.

sudo apt install docker.io

 

설치 후 동작확인

sudo docker run -it ubuntu bash
sudo docker run hello-world

 

설치가 완료 되어 다음과 같이 동작 확인을 했다.

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/
728x90
반응형

'Development > Docker' 카테고리의 다른 글

[Docker] ClickHouse DB 연동  (0) 2022.04.03
[Docker] Docker 의 개념  (0) 2021.07.21

댓글