* Container와 Host간 web server storage를 공유하도록 만드는 방법:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@host01-2 tmp]# mkdir -p /var/www/html
[root@host01-2 tmp]# docker run -d -p 8080:80 --name=MyWebServer2 -v /var/www/:/var/www testrun /usr/sbin/httpd -DFOREGROUND
490628c6230f2b49bfff4a414451206efb25ba05d7c0e1fffa2847c1851da4ce
 
 
[root@host01-2 tmp]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
490628c6230f        testrun             "/usr/sbin/httpd -DF…"   47 seconds ago      Up 45 seconds       0.0.0.0:8080->80/tcp   MyWebServer2
b528c114868f        testrun             "/usr/sbin/httpd -DF…"   22 minutes ago      Up 22 minutes       0.0.0.0:80->81/tcp     MyWebServer6
30a02bd19d93        testrun             "/usr/sbin/httpd -DF…"   22 minutes ago      Created                                    MyWebServer4
08fae41f9427        testrun             "/usr/sbin/httpd -DF…"   22 minutes ago      Created                                    MyWebServer5
62ce8a9673ae        testrun             "/usr/sbin/httpd -DF…"   25 minutes ago      Up 25 minutes       0.0.0.0:60->80/tcp     MyWebServer3
[root@host01-2 tmp]# docker exec -it MyWebServer2 bash
[root@490628c6230f /]#
 
cs


+ Recent posts