-
[Docker] 맥 OS에 Docker Desktop 설치하기Study/Docker&Kubernetes 2025. 1. 23. 20:09
도커를 공부하기 위해 도커를 설치해보려고 합니다
도커는 리눅스 기반 운영체제에서 가장 호환성이 좋은데, 현실적으로 리눅스 물리 서버를 당장 사용할수있는 사람은 없겠죠?
리눅스 서버를 사용하기 위해서는 컴퓨터에 가상머신을 설치하여 리눅스 운영체제 서버를 설치하거나, 아마존 EC2에 서버 인스턴스를 사용하는 방법이 있긴한데
저는 리눅스 서버를 사용하지않고 맥 OS를 사용하여 도커를 설치하도록 하겠습니다!
1. 도커 데스크탑 다운로드
아래 링크를 이동해서 자신의 pc 환경에 맞는 버전을 다운받습니다
https://docs.docker.com/desktop/setup/install/mac-install/
Mac
Install Docker for Mac to get started. This guide covers system requirements, where to download, and instructions on how to install and update.
docs.docker.com
docker Desktop for Mac with Apple sliicon 선택 docker.dmg 파일을 다운 받고 실행을 시켜 drag and drop을 진행합니다
Applications 폴더에 docker desktop 버전이 설치되었습니다!
2. 도커 데스크탑 실행
도커를 처음 실행한 화면입니다. Accept를 눌러주세요.
기본으로 세팅을 해놓고 Finish를 눌러주세요
3. 도커 데스크탑 회원가입
도커 계정이 없으면 계정을 생성합니다
저는 깃허브 연동으로 생성하겠습니다
인증을 했습니다!
도커에서 사용할 이름을 설정하고 Sign up 을 클릭합니다
회원가입이 되었고 도커를 실행하겠습니다
4. 도커 데스크탑 메인화면
처음 실행하게 되면 두개의 설문을 하는데요 스킵도 가능합니다!
본인의 상황에 맞는걸로 선택하면 될것같습니다
저는 back-end developer를 선택했어요
도커 데스크탑의 메인 화면이고 도커가 실행되어있습니다
5. 터미널에서 도커 설치 확인
이제 터미널을 통해서 도커가 설치되었는지 확인을 해보겠습니다.
아래 명령어를 통해 버전을 확인할수있습니다.
docker -v
도커의 버전은 27.4.0 입니다
6. 도커 작동 확인
도커가 작동하는지 테스트를 해보겠습니다
docker run hello-world
hello-world 는 도커가 제공하는 테스트 이미지입니다!
kimsokuri@gimsokuliui-MacBookAir DockerProject % docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world c9c5fd25a1bd: Download complete Digest: sha256:d715f14f9eca81473d9112df50457893aa4d099adeb4729f679006bf5ea12407 Status: Downloaded newer image for hello-world:latest 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. (arm64v8) 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/
이런 내용이 나오면 정상적으로 작동되는것입니다
그렇지만 hello-world라는 이미지를 생성한적이 없는데, 어떻게 나온걸까요?
명령을 좀 더 확인해보면
Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world c9c5fd25a1bd: Download complete Digest: sha256:d715f14f9eca81473d9112df50457893aa4d099adeb4729f679006bf5ea12407 Status: Downloaded newer image for hello-world:latest
hello-world 라는 이미지를 로컬에서 찾을 수 없다고 나와있습니다.
이미지가 존재하지않으면 도커 데몬은 public 레지스트리에서 이미지를 다운로드 받아 실행합니다.
저 화면은 도커 허브라는 public 레지스트리에서 hello-world라는 이미지를 다운받아 실행한 결과입니다!
https://hub.docker.com/_/hello-world
도커 허브에서는 누구나 이미지를 업로드 하고 다운로드 받을 수 있습니다.
다음글에서는 도커이미지와 컨테이너에 대해 알아보고 실습하도록 하겠습니다 >,,<
'Study > Docker&Kubernetes' 카테고리의 다른 글
[Docker] 도커 기초 개념 - 도커의 작동방식과 도커이미지, 컨테이너 실행 실습 (1) 2025.01.26 한 권으로 배우는 도커 & 쿠버네티스 - [PART 1] 2장 도커의 개념 (0) 2025.01.09 한 권으로 배우는 도커 & 쿠버네티스 - 1장 실습 환경 구축 하기 (0) 2025.01.06