Skip to content

Commit

Permalink
Update docker-cmds.md
Browse files Browse the repository at this point in the history
Added about MySQL
  • Loading branch information
Keesun Baik (a.k.a, Whiteship) authored Jul 21, 2018
1 parent 251bc7e commit 8e8a528
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker-cmds.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 8e8a528

Please sign in to comment.