Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
Scott Numamoto edited this page Jul 26, 2016 · 14 revisions

Dockumentation

What is Docker

Docker is a platform used to run and develop software. Docker is advantageous because it allows developers to run their software in the same environment would be run on a server or elsewhere.

[Get Started with Docker] (http://docs.docker.com/) will walk you through installation as well as your first image and container.

Important Vocabulary

  • Dockerfile: a list of commands to build a Docker image
  • Container: an isolated work environment on a Linux system
  • Image: Software that is loaded into a container that creates a specific state

If making an analogy to programming, an image could be thought of as a class, while a container could be thought of as an image.

Docker and Web Development

PiE runs the website through a Docker container on the web server.

To try running a website as it would be run on the server:

  1. Open Docker either using the Docker Quick Start Terminal or opening Kitematic and selecting Docker CLI

  2. Navigate to the website folder containing website info, but specifically docker-build.sh and dockerfile

  3. Run the following command to rebuild and run the website

     bash docker-build.sh
    

Thus docker will build an image with the tag pie-website using the files at ., the current folder. Specifically, Docker looks at the Dockerfile to build. The second command will then launch the server.

OSX

Once the server is running, run the following command to get an IP address that you would navigate to access the site

docker-machine ip default

Copy and paste the result which should look like an ip into your browser and add ":4000". It may look like http://192.168.99.100:4000/

Ubuntu

Once the server is running, then the site should be accessible at either 0.0.0.0:4000 or 127.0.0.0:4000 via your browser

Debugging

To look inside the container while it has an ENTRYPOINT set. This is useful for debugging.

docker run -ti --rm --entrypoint sh <DOCKER_IMAGE>

or

docker exec -it <CONTAINER_NAME> sh

Useful Resources