-
도커란(Docker)?!Docker 2022. 10. 29. 21:59
도커란?!
도커(Docker)실행해보기
1. 터미널에 커맨드(command)를 입력한다
docker run 이미지이름
2. 도커서버(도커 demon)가 그 커맨드를 받아 이미지를 생성 또는 컨데이너를 실행하게 된다
C:\Users\yunaj>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/
설명
1. 도커 클라이언트에 다가 커맨드를 입력하니 클라이언트에서 도커 서 버로 요청을 보냄
2. 서버에서 hello-world라는 이미지가 이미 로컬에 cache가 되어 있는지 확인 확인
3. 이미지가 cache에 없다면(Unable to find image ~) 라는 문구가 표시되고, Docker Hub이라는 이미지가 저장되어 있는 곳에 가서 그 이미 지를 가져오고 로컬에 Cache로 보관 한다
4. 그 후 이제는 이미지가 있으니 그 이미지를 이용해서 컨테이너를 생성
이미지로 컨테이너 만들기!
이미지로 어떻게 컨테이너를 만들까?!
- 이미지는 응용 프로그램을 실행하는데 필요한 모든 것을 포함하고 있다
1. 컨테이너가 시작될 때 실행되는 명령어 ex) run kakaotalk
2, 파일 스냅숏 ex) 컨테이너에서 카카오톡을 실행하고 싶다면 카카오톡 파일 (카카오톡을 실행하는데 필요한 파일) 스냅숏
* 파일 스냅숏은 디렉터리나 파일을 카피한 것
1. 파일 스냅숍에 있는 정보들은 하드디스크에 올려진다
2. 명령어는 컨테이너 시작시 실행 , 커널을 통해 하드 디스크에 있는 실행파일을 불러온다
C-group, 네임스페이스(Linux)를 쓸 수 있는 이유는?!
- docker verison을 확인해보니 server가 Linux이다
- docker는 Linux vm 위에서 돌고 있다
C:\Users\yunaj>docker version Client: Cloud integration: v1.0.24 Version: 20.10.17 API version: 1.41 Go version: go1.17.11 Git commit: 100c701 Built: Mon Jun 6 23:09:02 2022 OS/Arch: windows/amd64 Context: default Experimental: true Server: Docker Desktop 4.10.0 (82025) Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:01:23 2022 OS/Arch: linux/amd64
출처: 따라하며 배우는 도커와 CI 환경 by 인프런
'Docker' 카테고리의 다른 글
도커 클라이언트(docker client)명령어 알아보기 (0) 2022.10.29