Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active May 16, 2018 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/1b3511c33a89cbed38ad2404095732a4 to your computer and use it in GitHub Desktop.
Save shawngraham/1b3511c33a89cbed38ad2404095732a4 to your computer and use it in GitHub Desktop.
docker stuff related to odate
directory
|
|- Dockerfile
|- book  [with all of the html files]

In the Dockerfile:

FROM nginx:alpine
COPY book /usr/share/nginx/html

Build the docker container, which has an nginx webserver in it:

docker build -t textbook .

Run the server:

docker run  -d -p 8080:80 textbook

the '8080' is what you put in the address bar, eg: localhost:8080. The 80 is the container's port itself.

to see what containers are running,

docker ps -a

to stop the container: docker stop <id of container>

to restart docker start -ai <id of container>

to remove the image: docker rmi <image name>


So that works. But can I run from inside an ubuntu container? And... is it important?

so - get an ubuntu container. add some html. is there a way of running both a server inside it, and then also having terminal open?

probably.

but just do two containers.

-- so maybe see what the rocker/docker crowd has, start building with that. or use ryanfb's vsfm as a base...

--- what about this https://www.dataquest.io/blog/docker-data-science/ have R kernel in there too. So vsfm, jupyter, python, R.... and then do everything through jupyter notebooks? That might be ... cool. leave the textbook on a website... (or shit have it in a bunch of premade notebooks...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment