Docker Erste Schritte: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
=Initialer Start=
 
=Initialer Start=
*mkdir -p /srv/nginx/html
+
*mkdir -p /srv/apache2/htdocs
*cd /srv/nginx/
+
*cd /srv/apache2
*docker run --name some-nginx -v /srv/nginx/html:/usr/share/nginx/html:ro -d nginx
+
*docker run -dit --name my-apache -p 9080:80 -v /srv/apache2/htdocs:/usr/local/apache2/htdocs/ httpd:2.4
 +
=Läuft mein Container=
 +
*docker ps
 +
<pre>
 +
CONTAINER ID        IMAGE              COMMAND              CREATED            STATUS              PORTS                  NAMES
 +
fb2dcc90055e        httpd:2.4          "httpd-foreground"  19 minutes ago      Up 19 minutes      0.0.0.0:9080->80/tcp  my-apache
 +
</pre>
 +
=Stoppen=
 +
*docker stop my-apache
 +
my-apache
 +
=Starten=
 +
*docker start  my-apache
 +
my-apache
 +
=Stoppen zum entfernen=
 +
*docker stop my-apache
 +
my-apache
 +
=Entfernen des Containers=
 +
*docker rm  my-apache
 +
my-apache
 +
=Logging anschauen des Containers=
 +
*docker logs my-apache
 +
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
 +
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
 +
[Wed Mar 24 16:51:15.748143 2021] [mpm_event:notice] [pid 1:tid 140420729959552] AH00489: Apache/2.4.46 (Unix) configured -- resuming normal operations
 +
[Wed Mar 24 16:51:15.748236 2021] [core:notice] [pid 1:tid 140420729959552] AH00094: Command line: 'httpd -D FOREGROUND'

Aktuelle Version vom 25. März 2021, 08:07 Uhr

Initialer Start

  • mkdir -p /srv/apache2/htdocs
  • cd /srv/apache2
  • docker run -dit --name my-apache -p 9080:80 -v /srv/apache2/htdocs:/usr/local/apache2/htdocs/ httpd:2.4

Läuft mein Container

  • docker ps
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS                  NAMES
fb2dcc90055e        httpd:2.4           "httpd-foreground"   19 minutes ago      Up 19 minutes       0.0.0.0:9080->80/tcp   my-apache

Stoppen

  • docker stop my-apache
my-apache

Starten

  • docker start my-apache
my-apache

Stoppen zum entfernen

  • docker stop my-apache
my-apache

Entfernen des Containers

  • docker rm my-apache
my-apache

Logging anschauen des Containers

  • docker logs my-apache
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
[Wed Mar 24 16:51:15.748143 2021] [mpm_event:notice] [pid 1:tid 140420729959552] AH00489: Apache/2.4.46 (Unix) configured -- resuming normal operations
[Wed Mar 24 16:51:15.748236 2021] [core:notice] [pid 1:tid 140420729959552] AH00094: Command line: 'httpd -D FOREGROUND'