[Docker] Run MariaDB container and edit configuration

[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

screenshot001


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

screenshot002


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

screenshot003


1.4. Install vim

  • Update apt-get
(container)# apt-get update

screenshot004

  • Install vim
(container)# apt-get install vim

screenshot005


1.5 Edit MariaDB configuration

screenshot006

screenshot007

screenshot008

screenshot009


1.6. Restart container

# docker restart [CONTAINER_NAME]

screenshot010



References

댓글남기기

-->