Skip to content

Instantly share code, notes, and snippets.

@oprearocks
Created March 11, 2015 18:14
Show Gist options
  • Save oprearocks/7dae11015c1c619de0eb to your computer and use it in GitHub Desktop.
Save oprearocks/7dae11015c1c619de0eb to your computer and use it in GitHub Desktop.
GetTheEvent Docker image installation
# Docker image installation
## Installing [docker](https://www.docker.com/)
In order to install the dev environment, you first need to have Docker installed on your system. Navigate to the following url: https://docs.docker.com/installation/ look for your OS name in the list, and perform the setup following closely the steps outlined in the installation guide.
Please note that you should accept the full `boot2docker` installation as you will need all the tools that the installer has to offer -- especially VMWare.
In order to actually run the application, you need to build the image first(it will only happen once, and it will take a while — 5-20 min depending on your system configuration and network connection).
To be able to run the application inside a container, please save the archive that you received in a directory inside `c:/Users/<yourusername>` as `boot2docker` is nice enough to mount this inside your virtual machine, and have it available for you as `/c/<yourusername`.
The advantage of this workflow is that the actual image with all utilities installed has between 700 - 800 MB, instead of 3700 MB and in order to get it set up and to get the application running you have to issue 2 simple commands, to build and start the application.
## Building and running the application
1. Build from Dockerfile
After ƒollowing the installation instructions, start `boot2docker` and inside the VM navigate to `c:/Users/<yourusername>/project-folder`.
```
cd gte-app && git clone https://<yourbitbucketusername>@bitbucket.org/darung/gettheevent.git && docker build --no-cache -t gte-app .
```
2. Get coffee &mdash; It'll take between 5-20 minutes depending on network and machine capabilities
3. Run application
`./run`
Clarifications:
`-p HOST_PORT:GUEST_PORT #sets the port forwarding` -- in our case 3000 on guest 43211 on host
## Interacting with containers
Getting a hold of what the application is doing is easy, you just need to use the `docker ps` command to see which containers are running, and connect to your container's log queue with: `docker <containerId> logs -F`. This will basically tell docker to pipe all output from the VM to your terminal, just so you can get a more "verbose" view of the app.
## Caveats
1. Currently we are unable to get a bash shell inside the VM without running everything manually (run the command inside `run.sh` manually and then run the perl script once we're logged on to the machine)
2. There seems to be a bug(or feature) in the current `boot2docker` build for Windows where it asks for the password countless times -- this does not mean that the password is wrong but rather that the application needs permission to run.
* This could probably be solved by running the image with **Administrator** rights, or better yet, installing `boot2docker` straight off the bat with admin rights.
3. Boot2Docker for OSX and Windows requires you to install VirtualBox on your machine as `docker` was built for UNIX and needs a virtual environment to run on other OSs.
4. No access to the filesystem is provided but `boot2docker` is nice and mounts the `c:/Users` directory in the docker container that you are running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment