11

显示所有容器包括未运行的
C:\Users\Administrator>docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d2b002ddbabc miqumi/images-ubuntu16.04-0509 "/bin/bash" 39 hours ago Exited (0) 15 hours ago backend
a91bf5ae1ced miqumi/images-ubuntu16.04-0509 "/bin/bash" 39 hours ago Exited (0) 39 hours ago vol-backend
deb3c96dc837 miqumi/images-ubuntu16.04-0509 "/bin/bash" 47 hours ago Exited (255) 39 hours ago 0.0.0.0:30009->80/tcp umiqu0509
ca3e86e93829 miqumi/images-ubuntu16.04-0509 "/bin/bash" 47 hours ago Exited (0) 39 hours ago vol-svnfiles003


1.打开docker确认运行之后进行拉取
C:\Users\Administrator>docker pull miqumi/images-ubuntu16.04-0510
Using default tag: latest
latest: Pulling from miqumi/images-ubuntu16.04-0510
d3938036b19c: Already exists
a9b30c108bda: Already exists
67de21feec18: Already exists
817da545be2b: Already exists
d967c497ce23: Already exists
1b2331d10daf: Already exists
8646cdda3a42: Already exists
25c2dba07a96: Already exists
ac0a4273635a: Already exists
cc090f295fc4: Pull complete
Digest: sha256:f8c04bbf93a41bde449b75c31e4203a36096c769d760c9a49405696dea7295d9
Status: Downloaded newer image for miqumi/images-ubuntu16.04-0510:latest


2.列出本地镜像
C:\Users\Administrator>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
miqumi/images-ubuntu16.04-0510 latest 289d31977e86 12 hours ago 1.16GB
miqumi/images-ubuntu16.04-0509 latest 08d945c5cc01 2 days ago 823MB
docker4w/nsenter-dockerd latest cae870735e91 6 months ago 187kB

3.从容器vol-backend 拉取数据卷 命名为backend0511

这条命令表示Docker基于miqumi/images-ubuntu16.04-0510这个Docker镜像,创建一个名称为backend0511的容器,并把容器内部的30011端口与宿主机上的80端口做映射,使得通过宿主机30011端口的流量转发到容器内部的80端口上。

C:\Users\Administrator>docker run -it --volumes-from vol-backend --name backend0511 -p 30011:80 miqumi/images-ubuntu16.04-0510 /bin/bash

root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/#
root@5ca54aecdcf3:/# cd /
root@5ca54aecdcf3:/# ls
bin boot data dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var


root@5ca54aecdcf3:/# cd data
root@5ca54aecdcf3:/data# ls
logagent logagent_20180125.tgz sa
root@5ca54aecdcf3:/data# cd logagent
root@5ca54aecdcf3:/data/logagent# ls
bin java lib log logagent.conf

root@5ca54aecdcf3:/data/logagent# cd /
root@5ca54aecdcf3:/# ll
total 76
drwxr-xr-x 1 root root 4096 May 11 01:47 ./
drwxr-xr-x 1 root root 4096 May 11 01:47 ../
-rwxr-xr-x 1 root root 0 May 11 01:47 .dockerenv*
drwxr-xr-x 1 root root 4096 Apr 21 06:26 bin/
drwxr-xr-x 2 root root 4096 Apr 12 2016 boot/
drwxrwxrwx 4 root root 4096 May 10 13:20 data/
drwxr-xr-x 5 root root 360 May 11 01:47 dev/
drwxr-xr-x 1 root root 4096 May 11 01:47 etc/
drwxr-xr-x 1 root root 4096 Apr 21 06:14 home/
drwxr-xr-x 1 root root 4096 Apr 21 03:49 lib/
drwxr-xr-x 2 root root 4096 Apr 12 10:26 lib64/
drwxr-xr-x 2 root root 4096 Apr 12 10:26 media/
drwxr-xr-x 2 root root 4096 Apr 12 10:26 mnt/
drwxr-xr-x 2 root root 4096 Apr 12 10:26 opt/
dr-xr-xr-x 130 root root 0 May 11 01:47 proc/
drwx------ 1 root root 4096 May 10 13:33 root/
drwxr-xr-x 1 root root 4096 May 10 13:29 run/
drwxr-xr-x 1 root root 4096 Apr 21 03:48 sbin/
drwxr-xr-x 2 root root 4096 Apr 12 10:26 srv/
dr-xr-xr-x 13 root root 0 May 11 01:47 sys/
drwxrwxrwt 1 root root 4096 May 10 13:31 tmp/
drwxr-xr-x 1 root root 4096 Apr 12 10:26 usr/
drwxr-xr-x 1 root root 4096 Apr 21 03:39 var/

root@5ca54aecdcf3:/# ps -ef 进程查看命令
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 01:47 pts/0 00:00:00 /bin/bash
root 19 1 0 01:49 pts/0 00:00:00 ps -ef


root@5ca54aecdcf3:/# /etc/init.d/nginx start
* Starting nginx nginx [ OK ]
root@5ca54aecdcf3:/# /etc/init.d/php7.0-fpm start
root@5ca54aecdcf3:/# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 01:47 pts/0 00:00:00 /bin/bash
root 40 1 0 01:49 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 41 40 0 01:49 ? 00:00:00 nginx: worker process
www-data 42 40 0 01:49 ? 00:00:00 nginx: worker process
root 65 1 0 01:50 ? 00:00:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
www-data 66 65 0 01:50 ? 00:00:00 php-fpm: pool www
www-data 67 65 0 01:50 ? 00:00:00 php-fpm: pool www
root 68 1 0 01:50 pts/0 00:00:00 ps -ef


root@5ca54aecdcf3:/# cd data
root@5ca54aecdcf3:/data# ls
logagent logagent_20180125.tgz sa
root@5ca54aecdcf3:/data# cd logagent
root@5ca54aecdcf3:/data/logagent# ls
bin java lib log logagent.conf
root@5ca54aecdcf3:/data/logagent# bin/logagent --show_conf
Found java executable in LOGAGENT_PATH/java/jre


Java version "1.8.0_131"
18/05/11 01:52:20 INFO logagent.LogAgentMain: LogAgent version: SensorsAnalytics LogAgent_20180125
18/05/11 01:52:20 INFO logagent.LogAgentMain: Use FQDN as LogAgentID
18/05/11 01:52:20 INFO logagent.LogAgentMain: LogAgent ID: 5ca54aecdcf3
18/05/11 01:52:20 INFO logagent.LogAgentMain: Source config, path: '/data/sa', pattern: 'service.log.*'
18/05/11 01:52:20 INFO logagent.LogAgentMain: Service Uri: http://127.0.0.1:8106/log_agent
18/05/11 01:52:20 INFO logagent.LogAgentMain: Sender Type: BatchSender
18/05/11 01:52:20 INFO logagent.LogAgentMain: Pid file: /run/logagent/logagent.pid

root@5ca54aecdcf3:/data/logagent# nohup bin/logagent >/dev/null 2>&1 &
[1] 108

root@5ca54aecdcf3:/data/logagent# vim /run/logagent/logagent.pid


root@5ca54aecdcf3:/data/logagent# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 01:47 pts/0 00:00:00 /bin/bash
root 40 1 0 01:49 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 41 40 0 01:49 ? 00:00:00 nginx: worker process
www-data 42 40 0 01:49 ? 00:00:00 nginx: worker process
root 65 1 0 01:50 ? 00:00:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
www-data 66 65 0 01:50 ? 00:00:00 php-fpm: pool www
www-data 67 65 0 01:50 ? 00:00:00 php-fpm: pool www
root 108 1 4 01:52 pts/0 00:00:01 /data/logagent/bin/../java/jre/bin/java -classpath /data/logagent/bin/../lib/log_agent-1.0-SNAPSHOT.jar -Dsa.root.logger=DEBUG,DRFA,console -Dsa.log.file=/data/logagent/bin/../log/logagen
root 149 1 0 01:53 pts/0 00:00:00 ps -ef


root@5ca54aecdcf3:/data/logagent# cd /var/www
root@5ca54aecdcf3:/var/www# ls
basic html work


root@5ca54aecdcf3:/var/www# cd work
root@5ca54aecdcf3:/var/www/work# ls
backend common vendor yii


root@5ca54aecdcf3:/var/www/work# find / -name logagent

猜你喜欢

转载自www.cnblogs.com/starmoon2019/p/9023501.html
11
今日推荐