본문 바로가기
study/Devops

Docker 도커 입문 1 (feat. 생활코딩)

by stilinski 2022. 10. 14.
728x90

 

 

운영체제가 설치된 곳 - host

host에서 실행되는 격리된 각각의 실행 환경 - container (앱실행에 필요한 라이브러리와 실행 파일들이 들어있음)

 

이러한 기술을 컨테이너라고 부름.

 

도커와 같은 컨테이너 기술은 리눅스 운영체제의 기술.

도커가 알아서 리눅스가 깔아져있는 가상머신을 만들어줌.

 

https://docs.docker.com/desktop/install/windows-install/

 

Install Docker Desktop on Windows

 

docs.docker.com

도커 설치

 

무슨 WSL도 설치해야함.

https://learn.microsoft.com/ko-kr/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package

 

이전 버전 WSL의 수동 설치 단계

wsl install 명령을 사용하지 않고 이전 버전의 Windows에 WSL을 수동으로 설치하는 방법에 대한 단계별 지침입니다.

learn.microsoft.com

 

 

ubuntu 설치 후 에러 해결

 

cannot create /var/lib/landscape/landscape-sysinfo.cache: Permission denied

 

https://askubuntu.com/questions/1414483/landscape-sysinfo-cache-permission-denied-when-i-start-ubuntu-22-04-in-wsl

 

landscape-sysinfo.cache: Permission denied when I start Ubuntu 22.04 in WSL

I installed Ubuntu 22.04 on Windows 11 using WSL. I then moved it on another disk with the WSL commands (--export/--import). After moving it, the default user was root, so I added the below lines ...

askubuntu.com

 

첫번째 답변대로하면 없어짐.

 

 

이후 도커 실행 성공

 

 

도커 Pull

 

 

docker hub에서 찾아낸것을 컴터에 다운로드해서 가지고 있는 것을 image라고 함.

이미지 실행 - container

 

도커허브에 가서 httpd 다운

https://hub.docker.com/ 

 

Docker Hub Container Image Library | App Containerization

Build and Ship any Application Anywhere Docker Hub is the world's easiest way to create, manage, and deliver your team's container applications.

hub.docker.com

 

아파치 웹 서버를 컨테이너 위에서 실행시키기 위해 아파치 웹서버가 설치되어있는 컨테이너를 다운(pull)

 

docker images목록에 httpd 성공적

대시보드로도 보기 가능

 

 

Run

docker run [옵션] 이미지이름

docker ps  -실행중인 이미지 목록

docker ps -a   a옵션으로 모든 이미지들 볼 수 있음

 

이제 이름으로 실행 가능

logs 명령어로 로그보기

docker logs -f ws2

로 하면 로그 실시간 보기 가능

 

 

모든 명령어는 여기에 잘 정리되어있음.

https://docs.docker.com/engine/reference/commandline/pull/

 

docker pull

docker pull: Most of your images will be created on top of a base image from the [Docker Hub](https://hub.docker.com) registry. [Docker Hub](https://hub.docker.com) contains many pre-built images that you can `pull`...

docs.docker.com

 

728x90

'study > Devops' 카테고리의 다른 글

CI/CD를 위한 Jenkins 실습  (0) 2022.10.21
Jenkins와 CI/CD에 대해  (0) 2022.10.17
도커란? (feat. 드림코딩앨리)  (0) 2022.10.14
Docker 도커 입문 2 (feat. 생활코딩)  (0) 2022.10.14
CI/CD란? (feat. 드림코딩앨리)  (0) 2022.10.13

댓글