Skip to content

Instantly share code, notes, and snippets.

@Dodsaren
Created March 27, 2020 07:46
Show Gist options
  • Save Dodsaren/36042c8cee6d4616f60ef9481ff624c1 to your computer and use it in GitHub Desktop.
Save Dodsaren/36042c8cee6d4616f60ef9481ff624c1 to your computer and use it in GitHub Desktop.
docker run -d -p 8082:80 --mount type=bind,source="$(pwd)/htdocs",target=/var/www/html php:apache
1. If the Docker image php:apache is not present in your machine's local Docker registry, it will be downloaded from Docker hub.
2. It creates a new container based on the image php:apache.
3. It maps port 80 from the container to port 8082 on your host machine.
4. It mounts the directory htdocs/ from your host machine to /var/www/html in the container.
https://nelkinda.com/blog/apache-php-in-docker/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment