업무/Infra 설계

Docker

종금 2021. 12. 2. 15:41
반응형

 

KISA 클라우드 가이드가 생기며 가이드를 보니 도커에 대한 취약점 점검방법이 있어
해당 방법에 대해 직접 하고자 도커를 설치하였다

먼저 도커를 설치할 서버로 우분투를 사용했다. 이때 도커 공식사이트에서 OS버전을 확인하니
다음과 같아 20.04버전을 설치하기로 마음먹었다.

 

우분투 설치는 다음사이트에서 진행할 수 있다.
https://ubuntu.com/download/desktop

 

Download Ubuntu Desktop | Download | Ubuntu

Ubuntu is an open source software operating system that runs from the desktop, to the cloud, to all your internet connected things.

ubuntu.com

우분투 설치를 마치고

 

putty를 연결하려하니 몇몇파일이 없어서 net-tools랑 ssh설치를 진행하였다.

service ssh start로 ssh실행 후 putty로 로그인하였다.

 

putty접속후 제일 먼저 할일은 역시 apt업그레이드로 
sudo apt update && sudo apt upgrade를 진행

 

이후 도커 설치를 위해 다음 문서를 따르었다.
https://docs.docker.com/engine/install/ubuntu/

 

Install Docker Engine on Ubuntu

 

docs.docker.com

 

 

1. Docker 필수 패키지 설치

 

2. curl로 GPG Key 가져오기

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

3.아키텍쳐 확인하기 및 레파지토리 설치하기 (arch=amd64가 됨) 

(x86_64 -> amd64, armhf -> armhf, arm64 -> arm64)

echo \
  "deb [arch=$(dpkg --print-architecture) 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

 

 

4. 지금까지 가져온 부분에 대해 업데이트 및 도커 설치 

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

 

5. 레포 확인(도커 항구 설정확인)

apt-cache madison docker-ce

6. 도커 버전확인 

 

7. 헬로우월드 실행

 

Pull complete 뜨는거보고 설치 완료 확인

반응형