[Docker] Run MariaDB container and edit configuration
Goal
- To run MariaDB container
- To edit DB configuration including memory parameter and connector
Intro
- Install MariaDB in IBM Linux using docker
- I already received docker image in advance.
Practice
1. Run container
1.1 Check Docker images
# docker images
1.2. Create container from image
# docker run --name [CONTAINER_NAME] -e MYSQL_ROOT_PASSWERD=[PASSWORD] -d [IMAGE_NAME{:TAG}] # docker ps
–name : Container’s name
-e, –env : Set environment variables
-d, –detach : Run container in background and print container ID
1.3. Interface TTY with container
# docker exec -it [CONTAINER_NAME] /bin/bash
-i, –interactive : Keep STDIN open even if not attached
-t, –tty : Allocate a pseudo-TTY
1.4. Install vim
- Update apt-get
(container)# apt-get update
- Install vim
(container)# apt-get install vim
1.5 Edit MariaDB configuration
1.6. Restart container
# docker restart [CONTAINER_NAME]
댓글남기기