March 23, 2020
He covers: 1. What is Docker 2. Virtual Machines vs. Docker 3. Introduction to Dockerfiles, images and containers 4. The Docker Hub 5. Writing a Dockerfile 6. Building an image 7. Running a container 8. Mounting volumes 9. One process per container
In a new folder (
docker), create a subfolder (
src) and inside that a file
<?php echo "hello world";
Then in the
docker folder create your Dockerfile:
# Dockerfile FROM php:7.0-apache COPY /src/ /var/www/html/ EXPOSE 80
docker build -t hello-world .
Then run it:
docker run -p 80:80 hello-world
Now run it with your
src folder mounted as a volume:
docker run -p 80:80 -v ~/docker/src:/var/www/html/ hello-world
and you can edit the php folder and see the changes live.
So Dani’s Docker image for a GDS stack makes most sense when understood precisely as a geospatial variant on the Jupyter Notebook Docker images, with
darribas/gds_py:4.0 inheriting from
darribas/gds then inheriting from his
gds_py and adding R and the tidyverse.
Just like Jupyter’s
scipy-notebook inherit from
minimal-notebook, and then
datascience-notebook inherits from
scipy-notebook and adds R and Julia.
docker run -it --net=host -e DISPLAY=$DISPLAY -e \ XAUTHORITY=$XAUTHORITY -v $XAUTHORITY:$XAUTHORITY \ --name <container_name> <image_name>