Docker docker-ce-18.05.0.ce
SQL Server 2017 for Linux
上次在"docker find container ip"找出名稱為"sql1"容器的ip,接著要嘗試進入container使用bath
command:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
[root@localhost ~]# docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sql1
172.22.16.8
1.進入container的bash mode
command:
docker exec -it container_name bash
[root@localhost
dockervol2]# docker inspect -f '{{range
.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sql1
172.22.16.8
[root@localhost
dockervol2]# docker exec -it sql1 bash
root@sqltest01:/#
沒有留言:
張貼留言