主页

docker 拉取并启动镜像

2025-04-09 10:41AM

我想要拉取elastcsearch 8.6.1 镜像,并运行,可以根据下面的步骤进行操作:

1. 使用 $ docker pull elasticsearch:8.6.1 命令

$ docker pull elasticsearch:8.6.1
8.6.1: Pulling from library/elasticsearch
846c0b181fff: Pull complete
8808e7b116d8: Pull complete
1575487a3b14: Pull complete
b12eebc573f3: Pull complete
e2336bb55b75: Pull complete
a2665f0ae7e1: Pull complete
765d657a2677: Pull complete
47b66c25b220: Pull complete
e90d1b00a735: Pull complete
Digest: sha256:6242exxxxxxxxxxxxxxxxxxxxxxxxxxxx69d
Status: Downloaded newer image for elasticsearch:8.6.1
docker.io/library/elasticsearch:8.6.1

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview elasticsearch:8.6.1

2. docker images 查看镜像是否拉取成功

$ docker images
REPOSITORY       TAG       IMAGE ID       CREATED         SIZE 

elasticsearch    8.6.1     70xxxxxxxxx9a   2 years ago     1.29GB

3. 运行 elasticsearch 8.6.1 容器

$ docker run -d -p 9200:9200 -p 9300:9300 elasticsearch:8.6.1
f70xxxxxxxxxxxxxxxxxxxx2597a3

-d: 后台运行

-p 9200:9200: 映射 HTTP 端口(REST API)

-p 9300:9300: 映射集群通信端口

这样就可以啦~

返回>>

登录

请登录后再发表评论。

评论列表:

目前还没有人发表评论