ubuntu 20.04 docker

2023-12-20 10:21:20

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


sudo docker volume create prometheus-data

sudo docker run -p 9090:9090 -v /home/jack/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v prometheus-data:/prometheus -d  prom/prometheus

sudo docker ps -a 

sudo docker run --rm --name=node-exporter -p 9100:9100 -d prom/node-exporter

1

sudo docker pull grafana/grafana-enterprise

sudo docker run -d -p 3000:3000 --name=grafana grafana/grafana-enterprise

文章来源:https://blog.csdn.net/wowocpp/article/details/135089198
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。