ubuntu 20.04 docker

ubuntu 20.04 docker
https://docs.docker.com/engine/install/ubuntu/
Ubuntu20.04下部署linux资源监控平台(docker部署)grafana+prometheus+node_exporter(docker+离线包)
https://blog.csdn.net/deer_cui/article/details/134020816

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world

sudo apt-cache madison docker-ce | awk ‘{ print $3 }’

sudo docker pull prom/node-exporter
sudo docker run --rm --name=node-exporter -p 9100:9100 -d prom/node-exporter
其中,–rm参数表示容器退出时自动删除容器,–name参数指定容器的名称,-p参数将容器内的9100端口映射到主机的9100端口,-d参数表示在后台运行容器。
sudo docker pull prom/prometheus

你可能感兴趣的:(ubuntu,docker)