From 8e8a5282878c847431b24f5536de47eee481aefc Mon Sep 17 00:00:00 2001 From: "Keesun Baik (a.k.a, Whiteship)" Date: Sat, 21 Jul 2018 11:09:03 -0700 Subject: [PATCH] Update docker-cmds.md Added about MySQL --- docker-cmds.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docker-cmds.md b/docker-cmds.md index 49ed53e..e45febd 100644 --- a/docker-cmds.md +++ b/docker-cmds.md @@ -1,22 +1,41 @@ ### 컨테이너 상세 정보 보기 +``` docker inspect sharp_bartik +``` ### 컨테이너 아이디 가져오기 +``` CID=$(docker run -d monolith:1.0.0) +``` ### 컨테이너 아이피 가져오기 +``` CID=$(docker run -d monolith:1.0.0) CIP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}) +``` ### 컨테이너 전부 멈추기 +``` stop $(sudo docker ps -aq) +``` ### 컨테이너 전부 삭제 +``` docker rm $(sudo docker ps -aq) +``` +### MySQL + +``` +docker run -p 3306:3306 --name mysql_boot -e MYSQL_ROOT_PASSWORD=1 -e MYSQL_DATABASE=springboot -e MYSQL_USER=keesun -e MYSQL_PASSWORD=pass -d mysql + +docker exec -i -t mysql_boot bash + +mysql -u root -p +```