Handling Docker at console: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 25: Zeile 25:
 
|name of the image
 
|name of the image
 
|}
 
|}
 +
=show the running container=
 +
*docker ps
 +
<pre>
 +
CONTAINER ID        IMAGE                              COMMAND                  CREATED            STATUS                PORTS                                        NAMES
 +
d12860279ef5        im-apache-03                        "bash /start.sh"        11 minutes ago      Up 11 minutes        0.0.0.0:8480->80/tcp, 0.0.0.0:8443->443/tcp  co-apache
 +
</pre>

Version vom 8. Oktober 2019, 13:45 Uhr

Docker run an image

  • docker run -d -p 8480:80 -p 8443:443 -v /data/docker/apache_html:/var/www/html -v /data/docker/apache_etc:/etc/apache2 --name co-apache im-apache-03
Options
-d demon mode
-p 8480:80 host port 8480 to container port 80
-p 8443:443 host port 8443 to container port 443
-v /data/docker/apache_html:/var/www/html mount /data/docker/apache_html on host to var/www/html in the container
-v /data/docker/apache_etc:/etc/apache2 mount /data/docker/apache_etc on host /etc/apache2 in the container
--name co-apache name of the container
im-apache-03 name of the image

show the running container

  • docker ps
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS                PORTS                                         NAMES
d12860279ef5        im-apache-03                        "bash /start.sh"         11 minutes ago      Up 11 minutes         0.0.0.0:8480->80/tcp, 0.0.0.0:8443->443/tcp   co-apache