sudo docker run -it --rm --privileged ubuntu:18.04 bash
apt-get update
# ifconfig
apt install net-tools
# ping
apt install iputils-ping -y
sudo docker run -it --rm --privileged ubuntu:18.04 bash
sudo docker run -it --privileged --name ubuntu1 ubuntu:18.04 bash
构造镜像
dockerfile
FROM ubuntu:18.04
RUN apt-get update
RUN apt install net-tools -y
RUN apt install iputils-ping -y
RUN apt install curl -y
docker build -t ubuntu2 .