webapp.rb
: Web app written in Ruby using Sinatra. Includes a Dockerfile for containerized use- Use the
Dockerfile
to build a container and run it on your laptop or host - Look at the
Dockerfile
to see how the app is build and configured
- Install Docker on your laptop (Docker for Windows or Mac)
- Test that Docker is running properly, e.g.,
docker run docker/whalesay
, ordocker run --rm -it egray/cmatrix
- Clone code from github to your laptop
- Update
Dockerfile
with correct address of ElasticSearch - Build a container for your webapp
- Run the container and take and show photos
- Use git to clone the repo and then configure the
webapp
- Show local container images:
docker images
- Build a container (don't miss the dot '.' at the end):
docker build -t <image_name> .
- Run a container:
docker run --rm -it -p <host_port>:<container_port> <image_name>
- Show all running and non-running containers:
docker ps
docker ps -a
- Stop a running container:
docker stop <id>
- Exec a command (like a shell) into a running container:
docker exec -it <container-name-or-id> bash
- To detach yourself from the container, use the escape sequence CTRL+P followed by CTRL+Q.