728x90

Colima를 통한 도커 환경과 

도터 데스크탑 환경 이렇게 두가지 환경을 구축해놓음

mysql 계정 설정했던 환경은 도커 데스크탑 환경이었어서 colima를 통해 띄운 도커 컨테이너로는 접속이 안되었으나 

이를 모르고 잠시 헤맨 이야기

 

 

발단

..시작은 mysql 실행을 위한 설치 재설치 실행 실행실패를 하다보니 도커를 통해서 mysql을 설치했다.

전개

도커를 통해 mysql 접속도 성공함! 이미지 선택해서 컨테이너 실행해서 비밀번호도 만들고 들어가서 데이터베이스도 만들었다! 

위기

근데 도커데스크탑 중지하고 연결을 끊고나서 도커 cli를 통해 들어가려는데 계속 막히는 것.

어떻게 막혔냐.

먼저 도커 cli 접속안됨

❯ docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

그래서 colima를 켜서 접속함

절정

근데! 

docker exec -it my-mysql-container mysql -uroot -p

접속이 안됨

 

실행되는 컨테이너 ID를 확인해보니 docker desktop의 설정파일에서 본 컨테이너 ID와 다름

 

결말

colima를 껐을때랑 켰을 때랑 다른 도커가 켜지네

colima 끔

도커데스크탑만 켜둔 상태 (참고로 cli로 하면 desktop켜고 싶어도 colima끈상태로는 접속안됨)

❯ docker exec -it mysql-container bash
bash-4.4# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Your MySQL connection id is 15
Server version: 8.0.33 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.

mysql>

접속 성공! 

도꺼데스크탑 껐음

데이터베이스 서버 죽어서 연결끊김

 

결론

나는 Colima를 통한 도커 환경과 

도터 데스크탑 환경 이렇게 두가지 환경을 구축해놨었다.

mysql 계정 설정했던 환경은 도커 데스크탑 환경이었어서 colima를 통해 띄운 도커 컨테이너로는 접속이 안되었던 것이다. 

 

Colima 는? 도커 컨테이너를 맥이랑 리눅스에서 실행하기 위한 오픈소스다.

https://github.com/abiosoft/colima

 

나는 왜 colima를 설치했었나..

맞다 오라클 공부해보려고 설치하는데 도커 데스크탑으로는 안된다고 해서 colima를 통해 깔았음

이후로 도커를 안써서 까먹고 있었네 딱콩!

 

나의 환경

 

 

도커 자체가 엔진이라서 다른 환경에서 쓸 수 있었다

도커 데스크탑을 통해서 도커 엔진을 윈도우, 맥환경, 리눅스에서 쓸 수 있다고 한다. 

이렇게 도커 데스크탑을 쓰다가 이슈가 터져서 사람들이 대안으로 많이쓰는게 지금

podman, colima..등등 있다고 함

https://konfuzio.com/en/docker-desktop-alternative/

 

 

 

 

읽은 글들

 

[Docker] 맥북M1에 도커 컨테이너 colima설치

 

[Docker] 맥북M1에 도커 컨테이너 colima설치

ㅁ 들어가며 Docker Desktop의 이용약관을 보면 대기업에서는 이제 무료로 사용할 수 없게 되었습니다. 그리고 Intel 칩에서만 가동되었던 오라클 컨테이너의 경우 M1에는 돌아가지 않는 문제점도 있

peterica.tistory.com

도커데스크 업데이트 내용

Docker is Updating and Extending Our Product Subscriptions | Docker

 

Docker is Updating and Extending Our Product Subscriptions | Docker

Learn from Docker experts to simplify and advance your app development and management with Docker. Stay up to date on Docker events and new version

www.docker.com

 

Difference between Docker Desktop and Docker Engine

 

Difference between Docker Desktop and Docker Engine

Technically the engine can run without the cli-client being installed. Furthermore, the cli-client can be installed on a system without the engine and use it with a remote engine. The cli-client is nothing than a user interface that interacts with the api

forums.docker.com

 

Why does Colima failed to find Docker daemon

 

Why does Colima failed to find Docker daemon

I was using Docker Desktop on my Mac for a long time. Currently Docker desktop causing a huge issues related to starting up. Everytime it needs some tweak to run or uninstall and install it again, ...

stackoverflow.com

 

What is difference between Docker and Docker Desktop?

 

What is difference between Docker and Docker Desktop?

I am using a mac and apparently installing Docker Desktop is mandatory to use Docker in macOS. Why Docker Desktop is required in Mac and Windows OS, and not in Linux? What purpose Docker Desktop se...

stackoverflow.com

 

 

homebrew에서 docker를 설치하면 기본으로 도커 데스크탑으로 설치됨 

How to use Docker without Docker Desktop on MacOS 📦

 

How to use Docker without Docker Desktop on MacOS 📦

Preamble I think a lot of large software teams have struggled with Docker's licensing...

dev.to

 

도커(Docker) 입문편: 컨테이너 기초부터 서버 배포까지

 

도커(Docker) 입문편: 컨테이너 기초부터 서버 배포까지

도커(Docker)는 2013년 등장한 컨테이너 기반 가상화 도구입니다. 도커를 사용하면 컨테이너를 쉽게 관리할 수 있으며, 이미지를 만들어 외부 서버에 배포하는 것도 가능합니다. 이 글은 도커를 시

www.44bits.io

 

 

 

728x90

+ Recent posts