Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- RDBMS
- mysql
- cdb
- Cloud DB for MySQL
- InnoDB
- jmeter
- slack
- zabbix
- Connection
- RDS
- online ddl
- autovacuum
- OD
- MyISAM
- maxclients
- ncloud
- opensource
- postgresql
- Maria
- Docker
- 6.2.7
- Replication
- NOSQL
- 성능테스트
- DML
- vacuum
- NCP
- REDIS
- ROLLBACK
- mongo
Archives
- Today
- Total
개인 공부
[ MySQL ] Docker MySQL 이미지 생성 본문
반응형
테스트 DB를 구성하는데 있어 보다 편하게 하고싶어서 Docker 이미지를 생성하고 해당 이미지로 Container DB 생성을 해보았습니다.
이후에 해당 이미지를 이요하여 Container Replication을 구성해 볼 예정입니다.
[root@pmm-server ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
508674e5261a centos:7 "/bin/bash" 8 minutes ago Up 8 minutes centos7
4c349fab5687 centos "/bin/bash" 58 minutes ago Up 57 minutes centos
44eeafff66ca percona/pmm-server:2 "/opt/entrypoint.sh" 13 days ago Up About an hour (healthy) 0.0.0.0:8080->80/tcp, 0.0.0.0:10443->443/tcp pmm-server
### Container 설정
[root@pmm-server ~]# docker exec -it centos7 /bin/bash
( MySQL8 버전 설치 )
### Docker Image 생성
[root@pmm-server ~]# docker commit -a "leeyun" centos7 leeyunhyeong/mysql8:1
sha256:813b7347310b844852f4a3e89e09dcb206ad7b01632afd8e66b71ce771a0cde8
### Docker Image 테스트
[root@pmm-server ~]# docker run -it --name my -d leeyunhyeong/mysql8:1
[root@pmm-server ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
19372ea06f51 leeyunhyeong/mysql8:1 "/bin/bash" 5 minutes ago Up 5 minutes my
[root@pmm-server ~]# docker exec -it my /bin/bash
### Docker Hub 넣기
[root@pmm-server ~]# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: leeyunhyeong
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[root@pmm-server ~]# docker push leeyunhyeong/mysql8:1
The push refers to repository [docker.io/leeyunhyeong/mysql8]
3590a870c6c8: Pushed
174f56854903: Pushed
1: digest: sha256:5870ca603617e7381c8b9fdaf37721368a716caa19818f62b8806ec0a074db82 size: 743
[root@pmm-server ~]# docker pull leeyunhyeong/mysql8:1
1: Pulling from leeyunhyeong/mysql8
2d473b07cdd5: Already exists
90be23feaba8: Already exists
Digest: sha256:5870ca603617e7381c8b9fdaf37721368a716caa19818f62b8806ec0a074db82
Status: Downloaded newer image for leeyunhyeong/mysql8:1
docker.io/leeyunhyeong/mysql8:1
반응형
'MySQL & Maria' 카테고리의 다른 글
[ MySQL ] Openging Table 상태 (3) | 2023.02.17 |
---|---|
[ MySQL ] Container DB Replication ( Using. Docker-compose ) (2) | 2023.02.15 |
[ MYSQL ] NCP - Cloud DB for MySQL 구축 (0) | 2023.01.19 |
[ MySQL ] 괜찮아 보이는 블로그 추천 (0) | 2023.01.10 |
[ MySQL ] ProxySQL Query 빈도수 통계 작업 (0) | 2023.01.06 |