Difference between revisions of "Docker build . -t php-apache"

From wikieduonline
Jump to navigation Jump to search
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  
 +
[[docker build . -t]] php-apache-app
 +
[[FROM]] [[php:apache]]
 +
[[COPY]] . /var/www/html
 +
[[WORKDIR]] /var/www/html
 +
[[CMD]] [ "php", "./[[index.php]]" ]
 +
[[EXPOSE 80]]
  
  FROM php:apache
+
  [[docker run -d]] php-apache -n php-apache-app
  COPY . /usr/src/myapp
+
  Hello World!We are learning PHP!%
WORKDIR /usr/src/myapp
 
CMD [ "php", "./your-script.php" ]
 
  
 +
== Related ==
 +
[[php:apache]] image
 +
[[docker run -d]] php-apache-app
  
[[php:apache]]
+
== See also ==
 +
* {{docker build}}
  
 
+
[[Category:PHP]]
{{docker build}}
 

Latest revision as of 13:30, 15 February 2024

docker build . -t php-apache-app
FROM php:apache
COPY . /var/www/html
WORKDIR /var/www/html
CMD [ "php", "./index.php" ]
EXPOSE 80
docker run -d php-apache -n php-apache-app
Hello World!We are learning PHP!%

Related[edit]

php:apache image
docker run -d php-apache-app

See also[edit]

Advertising: