-
Notifications
You must be signed in to change notification settings - Fork 47
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.
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
PiE runs the website through a docker container on the web server.
To try running a website identical to the site run on server:
-
Open Docker either using the Docker Quick Start Terminal or opening Kitematic and selecting Docker CLI
-
Navigate to the website folder containing website info, but specifically docker-build.sh and dockerfile
-
Run the following command
bash docker-build.sh
This will execute the following command
docker build -t pie-website .;
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.
To run use the following command
docker run -d -p 4000:4000 pie-website
Once the server is running, run the following command to navigate to the site in browser.
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/
To look inside the container while it has an ENTRYPOINT set. This is useful for debugging.
docker run -ti --rm --entrypoint sh <DOCKER_IMAGE>
Building your own Docker image Keywords for writing a Dockerfile