<aside> ℹ️ 이 단계에서 해야할 것
Dockerfile
$ docker build -t mariadb:42 .
$ docker image ls
$ docker run -d mariadb:42
$ docker ps -a
$ docker exec -it mariadb:42 /bin/sh
$ mariadb-admin ping -h localhost -u root
$ mariadb -u root -p -h localhost -P 3306
> show databases;
> use wordpress;
> show tables;
> desc 테이블명;
> select * from 테이블명;
> exit
$ exit
docker-compose.yaml
$ docker network ls
$ docker volume ls
$ docker volume inspect mariadb
$ ls /home/minjungk/data/
최종적으로 컨테이너 기동 시 (healthy)
로 부팅할 수 있도록 HEALTHCHECK
설정
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44a69f4d5b84 mariadb:42 "/docker-entrypoint.…" 31 seconds ago Up 29 seconds (healthy) 3306/tcp mariadb
</aside>
Installing System Tables (mariadb-install-db)
mariadb - Official Image | Docker Hub
--bootstrap
모드 사용 추천FLUSH PRIVILEGES
에 대해서 찾아보는 거 추천$ docker exec -it mariadb /bin/sh
$ mariadb-admin ping -h localhost -u root
$ mariadb -u root -p -h localhost -P 3306
$ mariadb -u root
> show databases;
> use wordpress;
> show tables;
> desc 테이블명;
> select * from 테이블명;
> exit