下载运行一些必要的镜像
下载运行nginx
docker pull nginx
[root@iZh40ti53pk77iZ blog]
be2700afa519e1b0966621dc93afc5a8907be9fe7f38c1e32640d801136a82b5
[root@iZh40ti53pk77iZ blog]
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
be2700afa519 nginx "/docker-entrypoint.…" 9 seconds ago Up 8 seconds 0.0.0.0:8083->80/tcp, :::8083->80/tcp nginx01
[root@iZh40ti53pk77iZ blog]
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
[root@iZh40ti53pk77iZ blog]
root@be2700afa519:/
nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx
root@be2700afa519:/
root@be2700afa519:/etc/nginx
conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params
下载运行Tomcat
docker run -it --rm tomcat:9.0
docker pull 镜像名
[root@iZh40ti53pk77iZ blog]
Using default tag: latest
latest: Pulling from library/tomcat
0bc3020d05f1: Pull complete
a110e5871660: Pull complete
83d3c0fa203a: Pull complete
a8fd09c11b02: Pull complete
96ebf1506065: Pull complete
b8bf70f9cc4d: Pull complete
c40dfdcbe7c0: Pull complete
5801219e4666: Pull complete
f1a430cc3b65: Pull complete
f646de4fc337: Pull complete
Digest: sha256:7f1ba17594db775ebcdd6d214c4e25c022553b5bb8323987fb7e552678e3f6f2
Status: Downloaded newer image for tomcat:latest
docker.io/library/tomcat:latest
docker run -d -p 8083:8080 --name tomcat01 tomcat:9.0
[root@iZh40ti53pk77iZ blog]
下载启动elasticsearch
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.6.2
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c0c8209e7430 elasticsearch 0.19% 1.263GiB / 3.498GiB 36.10% 1.78kB / 942B 64.4MB / 820kB 43
[root@iZh40ti53pk77iZ blog]
{
"name" : "c0c8209e7430",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "enIcdA-mTgeZSCoGaRLpCA",
"version" : {
"number" : "7.6.2",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
"build_date" : "2020-03-26T06:34:37.794943Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
docker run -d --name elasticsearch02 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" elasticsearch:7.6.2
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
dca7c5fbed8d elasticsearch02 0.53% 428.8MiB / 3.498GiB 11.97% 836B / 0B 154MB / 839kB 44