docker run -d -p portal:portal --name XX XX 启动镜像
{
$ sudo docker run ubuntu:14.04 /bin/echo 'hello world'
docker run : 创建并启动一个“容器”
ubuntu:14.04 : 运行起来的“容器”的源. Docker把源叫做“镜像”. 这个例子我们用Ubuntu 14.04 镜像创建并启动了一个容器.【也可以直接写ubuntu,这样获取的是ubuntu:latest image】
/bin/echo ‘Hello world‘ :让容器执行的命令?
当我们创建并启动了一个新的ubuntu 容器的时候,容器执行这条命令。我们会在控制台看到输出:Hello world
}
{
$ sudo docker run -t -i ubuntu:14.04 /bin/bash
–t选项让Docker分配一个伪终端并绑定到容器的标准输入上
-I 则让容器的标准输入保持打开
/bin/bash.:在容器里运行 bash 应用
}
docker inspect ** 查询容器信息
docker ps查看容器
docker stop **停止容器
docker rm **删除容器
docker logs -f ** 查询容器日志
docker exec -it b7866ffe1ba7 /bin/bash 为容器分配一个终端
mysql -u root -p 进入数据库
use database; 使用数据库,
get : curl -i -H 'content-type: application/json' -X GET 172.17.0.3:8010/api/v1/getSctpInfo?wlan_name="sahnghai"
curl -i -H 'content-type: application/json' -X GET 172.17.0.3:8010/api/v1/getSctpInfo?assocID='1'
add: curl -i -H 'content-type: application/json' -X POST -d '{"moId": "1" ,"assocID":11,"property":1, "localPort":31642,"remotePort": 31642, "localIP1":"1.1.1.1","localIP2":"1.1.1.1","localIP3":"1.1.1.1","localIP4":"1.1.1.1", "remoteIP1":"2.2.2.2", "remoteIP2":"2.2.2.2", "remoteIP3":"2.2.2.2", "remoteIP4":"2.2.2.2","wlan_name":"WuHan"}' 172.17.0.3:8010/api/v1/addSctpInfo
delete: curl -i -H 'content-type: application/json' -X DELETE 172.17.0.3:8010/api/v1/deleteSctpInfo?assocID='1'
edit; curl -i -H 'content-type: a:1, "localPort":33,"remotePort": 34, "localIP1":"1.2.1.1","localIP2":"1.3.1.1","localIP3":"1.1.4.1","localIP4":"1.1.1.1", "remoteIP1":"2.2.2.2", "remoteIP2":"2.2.2.2", "remoteIP3":"2.2.2.2", "remoteIP4":"22.22.11.11","wlan_name":"NanJing"}' 172.17.0.3:8010/api/v1/editSctpInfo