본문 바로가기

IT

Ubuntu 20 Dokcer phpymadmin

반응형
docker network create phpmyadmin-network
docker pull mysql
docker pull phpmyadmin/phpmyadmin
docker images #check images

docker volume create mysql-data
docker volume inspect mysql-data #check config
[
    {
        "CreatedAt": "2021-06-13T17:49:45+09:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/mysql-data/_data",
        "Name": "mysql-data",
        "Options": {},
        "Scope": "local"
    }
]

to acess Mountpoint easylier, I make link

ln -s /var/lib/docker/volumes/mysql-data/_data /mysql

#to start mysql container
docker run -d --name mysql-server -v mysql-data:/var/lib/mysql --network phpmyadmin-network -e "MYSQL_ROOT_PASSWORD=kamisama123" mysql

#to start phpmyadmin container
docker run -d --name phpmyadmin -p 80:80 --network phpmyadmin-network -e PMA_HOST=mysql-server phpmyadmin/phpmyadmin

#To check IP adress
docker inspect CONTAINER_ID

ETC docker commend

 

docker ps -a #container status
docker ps -a -f name=phpmyadmin
docker ps -a -f name=mysql-server

docker container stop phpmyadmin
docker container stop mysql-server 

docker container start phpmyadmin
docker container start mysql-server

docker container restart phpmyadmin
docker container restart mysql-server

docker logs phpmyadmin
docker logs mysql-server

'IT' 카테고리의 다른 글

React native google login  (0) 2021.07.12
react native 유용한 UI  (0) 2021.06.29
react native TouchableOpacity 동작 안할떄  (0) 2021.06.02
NODE_OPTIONS 에러가 날 경우  (0) 2021.03.25
jenkins, aws 이용방법  (0) 2021.02.25