local

Docker安装Ubuntu

[email protected]:~$ ifconfig
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:42ff:fe11:e9a4  prefixlen 64  scopeid 0x20<link>
        ether 02:42:42:11:e9:a4  txqueuelen 0  (Ethernet)
        RX packets 95092  bytes 8389850 (8.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 96253  bytes 164516574 (164.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.24.58  netmask 255.255.254.0  broadcast 192.168.25.255
        inet6 fe80::20c:29ff:fe98:3905  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:98:39:05  txqueuelen 1000  (Ethernet)
        RX packets 270096  bytes 229940235 (229.9 MB)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 155327  bytes 17546195 (17.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 255  bytes 19360 (19.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 255  bytes 19360 (19.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth5ae08ca: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::74fc:33ff:fe9b:6302  prefixlen 64  scopeid 0x20<link>
        ether 76:fc:33:9b:63:02  txqueuelen 0  (Ethernet)
        RX packets 28866  bytes 2560094 (2.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 29165  bytes 50721352 (50.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[email protected]:~$

下载ubuntu镜像

docker pull ubuntu

Docker安装Ubuntu

 创建ubuntu容器

docker run -it -p 80:80 ubuntu /bin/bash

Docker安装Ubuntu

apt-get update

Docker安装Ubuntu

apt install wget net-tools

Docker安装Ubuntu

[email protected]:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.2  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:ac:11:00:02  txqueuelen 0  (Ethernet)
        RX packets 29165  bytes 50721352 (50.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28866  bytes 2560094 (2.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[email protected]:~# 

Docker安装Ubuntu

apt install gcc make libpcre3 libpcre3-dev zlib1g-dev

Docker安装Ubuntu

访问:

Docker安装Ubuntu

=>修改容器端口:

Docker安装Ubuntu

docker stop 6ca17a06c281(CONTAINER ID)

service docker stop

Docker安装Ubuntu

改变权限,进入 containers ,容器列表目录

Docker安装Ubuntu


sudo vim hostconfig.json (前为容器,后为宿主机端口)

Docker安装Ubuntu

sudo vim config.v2.json 

Docker安装Ubuntu

启动docker服务

启动容器并进入

Docker安装Ubuntu

编辑nginx配置端口88

Docker安装Ubuntu

 

 

相关文章:

  • 2021-09-22
  • 2021-09-06
  • 2022-02-11
  • 2022-02-27
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2021-05-31
  • 2021-09-16
  • 2021-09-07
相关资源
相似解决方案