nutt@nutt-pc:~$ docker network create --driver=bridge --subnet=172.27.0.0/16 \ > --ip-range=172.27.5.0/24 \ > --gateway=172.27.5.254 \ > my-net 1721e834110c184f92ce2ae1008bf5f5dcd735f38a7d35f6bbcc9eebc4d5de8e nutt@nutt-pc:~$ docker network inspect my-net [ { "Name": "my-net", "Id": "1721e834110c184f92ce2ae1008bf5f5dcd735f38a7d35f6bbcc9eebc4d5de8e", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": {}, "Config": [ { "Subnet": "172.27.0.0/16", "IPRange": "172.27.5.0/24", "Gateway": "172.27.5.254" } ] }, "Internal": false, "Containers": {}, "Options": {}, "Labels": {} } ]
nutt@nutt-pc:~$ docker run -it --net="my-net" --add-host="jmeter-server:172.27.5.1" --mac-address="9a:17:a0:c7:b4:cb" --ip="172.27.5.1" --name jmeter-server1 ubuntu bash root@c07696364171:/# root@c07696364171:/# root@c07696364171:/# root@c07696364171:/# root@c07696364171:/# apt-get update Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial/main Sources [1103 kB] Get:5 http://archive.ubuntu.com/ubuntu xenial/restricted Sources [5179 B] Get:6 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB] Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB] Get:8 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB] Get:9 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB] Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main Sources [244 kB] Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [124 kB] Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [506 kB] Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [418 kB] Get:14 http://archive.ubuntu.com/ubuntu xenial-security/main Sources [51.4 kB] Get:15 http://archive.ubuntu.com/ubuntu xenial-security/universe Sources [11.1 kB] Get:16 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [191 kB] Get:17 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [52.5 kB] Fetched 24.3 MB in 11s (2109 kB/s) Reading package lists... Done
Create DOCKERFILE
No comments:
Post a Comment