-
P1_C2_3. 도커 및 도커 컴포즈 , 도커를 이용한 개발환경 만들기(MySQL 도커 연동하기)Anna belly belly hard/java_spring 2023. 5. 12. 22:52반응형
1. 도커
- 컨테이너 기반의 가상화 플랫폼
1) 컨테이너 기반의 가상화
2) 하이퍼바이저 기반의 가상화(OS 가상화)
2. 도커 허브
- 도커에서 제공하는 이미지 저장소
Docker: Accelerated, Containerized Application Development
Docker is a platform designed to help developers build, share, and run modern applications. We handle the tedious setup, so you can focus on the code.
www.docker.com
- https://hub.docker.com/_/mysql
mysql - Official Image | Docker Hub
Quick reference Supported tags and respective Dockerfile links 8.0.33, 8.0, 8, latest, 8.0.33-oracle, 8.0-oracle, 8-oracle, oracle 8.0.33-debian, 8.0-debian, 8-debian, debian 5.7.42, 5.7, 5, 5.7.42-oracle, 5.7-oracle, 5-oracle 5.7.42-debian, 5.7-debian, 5-
hub.docker.com
3. 도커 컴포즈
- 다중 컨테이너를 정의하고 실행하기 위한 도구
- YAML 파일을 사용하여 다중 컨테이너를 구성함
- https://docs.docker.com/compose/
Docker Compose overview
docs.docker.com
4. 도커를 이용한 개발 환경 구성하기
1) 도커 설치
- https://www.docker.com/products/docker-desktop/
Download Docker Desktop | Docker
Docker Desktop is available to download for free on Mac, Windows, or Linux operating systems. Get started with Docker today!
www.docker.com
- 설치가 완료되면 명령어를 통해 설치가 제대로 됬는지 확인
docker -v
2) MySQL 도커 이미지 다운로드
Docker Hub Container Image Library | App Containerization
Deliver your business through Docker Hub Package and publish apps and plugins as containers in Docker Hub for easy download and deployment by millions of Docker users worldwide.
hub.docker.com
3) MySQL 도커 컨테이너 생성 및 실행
docker pull mysql:latest docker run --name mysql-sample-container -e MYSQL_ROOT_PASSWORD=<password> -d -p 3306:3306 mysql:{version} docker ps -a
4) 현재 실행중인 도커 컨테이너 목록 출력
docker ps -a
5) MySQL 도커 컨테이너 접속
docker exec -it {도커 컨테이너 이름} bash
6) MySQL 접속
mysql -u root -p
반응형'Anna belly belly hard > java_spring' 카테고리의 다른 글
P1_C3_2. 테스트 코드- 비밀번호 유효성 검증기 만들기 (0) 2023.05.13 P1_C3_1. 테스트 코드 작성하기 (0) 2023.05.12 P1_C2_2. 웹 개발 환경 구성하기 (0) 2023.05.12 P1_C2_1. intellj IDEA 프로젝트 생성 방법 (0) 2023.05.12 P1_C1. 개발 환경 구축(JDK & 통합개발 환경 & 톰캣 설치) (1) 2023.05.12