docker运行image相关命令

来源:互联网 发布:教学视频录制软件 编辑:程序博客网 时间:2024/06/05 15:33
docker load --input feuyeux.kafka.tar
docker load --input feuyeux.zookeeper.tar
docker load --input hub.nginx.tar


docker images


docker kill $(docker ps -q) & docker rm $(docker ps -a -q)


sudo docker run -d \
 --name=zk1 \
 --net=host \
 -e SERVER_ID=1 \
 -e APPEND_1=server.1=localhost:2888:3888 \
 -e APPEND_2=server.2=localhost:2889:3889 \
 -e APPEND_3=server.3=localhost:2890:3890 \
 -e APPEND_4=clientPort=2181 \
 feuyeux/zookeeper
 
 
 sudo docker run -d \
 --name=zk2 \
 --net=host \
 -e SERVER_ID=2 \
 -e APPEND_1=server.1=localhost:2888:3888 \
 -e APPEND_2=server.2=localhost:2889:3889 \
 -e APPEND_3=server.3=localhost:2890:3890 \
 -e APPEND_4=clientPort=2182 \
 feuyeux/zookeeper
 
 sudo docker run -d \
 --name=zk3 \
 --net=host \
 -e SERVER_ID=3 \
 -e APPEND_1=server.1=localhost:2888:3888 \
 -e APPEND_2=server.2=localhost:2889:3889 \
 -e APPEND_3=server.3=localhost:2890:3890 \
 -e APPEND_4=clientPort=2183 \
 feuyeux/zookeeper
 
 
sudo docker run -d \
--name ka101 \
-e BROKER_ID=1 \
-e HOST_IP=localhost \
-e PORT=9093 \
-e ZK=10.160.5.18:2181,10.160.5.18:2182,10.160.5.18:2183 \
-P \
feuyeux/kafka 


sudo docker run -d \
--name ka102 \
-e BROKER_ID=2 \
-e HOST_IP=localhost \
-e PORT=9094 \
-e ZK=10.160.5.18:2181,10.160.5.18:2182,10.160.5.18:2183 \
-P \
feuyeux/kafka 


sudo docker run -d \
--name ka103 \
-e BROKER_ID=3 \
-e HOST_IP=localhost \
-e PORT=9095 \
-e ZK=10.160.5.18:2181,10.160.5.18:2182,10.160.5.18:2183 \
-P \
feuyeux/kafka


sudo docker run -d \
--name nginx1 \
-v /tmp/website:/usr/share/nginx/html \
-v /tmp/nginx.conf:/etc/nginx/nginx.conf:ro \
-p 8000:80 \
index.tenxcloud.com/docker_library/nginx


#/tmp/website/index.html
<head>
  <title>Web Application for Nginx on Docker</title>
</head>
<body>
  <h1>Hello</h1>
  <p>Anything is OK.</p>
</body>


#/tmp/nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events { }
http {
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 65;
  types_hash_max_size 2048;
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  gzip on;
  gzip_disable "msie6";
  include /etc/nginx/conf.d/*.conf;
}
0 0
原创粉丝点击