Re-Write WeatherAPP

TurnToJPG -->


Building the Environment

First clone the Vagrant Repo from:

$ pwd
$ git clone
$ cd coreos-vagrant
$ cp config.rb.sample config.rb
$ cp user-data.sample user-data

Cluster Setting

Edit the config.rb, for configurating the instance and the official CoreOS channel:

# Size of the CoreOS cluster created by Vagrant
# Official CoreOS channel from which updates should be downloaded

Now start the vagrant and view its status:

$ vagrant up
$ vagrant status
Current machine states:

core-01                   running (virtualbox)
core-02                   running (virtualbox)
core-03                   running (virtualbox)
$ vagrant ssh core-1

After you login to the coreOS, you could view the status of this virtual machine. Each of the machine have 1 Core, 1G ram, 20G harddisk.

Single Machine

Just comment the following lines of the config.rb:

# $num_instances=3

This will bring one instance of vagrant based CoreOS machine.


I want to write my APPs using NodeJS, thus I want to setup the NodeJS dev environment on CoreOS based Docker. Following are the steps:
First configure the proxy of docker:

$ sudo mkdir /etc/systemd/system/docker.service.d
$ sudo vim http-proxy.conf
To apply the change, reload the unit and restart docker:
$ systemctl daemon-reload
$ systemctl restart docker

Now you could use docker for pulling back some container and run.

$ docker search base
$ docker pull base
$ docker images
$ docker run base /bin/bash -c "ls /"
$ docker run base /bin/bash -c "cat /etc/issue"

Since the network is not good, I created the droplet on DigitalOcean, and installed CoreOS.

Steps is listed as following:

$ git clone
$ cd eb-py-flask-signup
$ git checkout master
$ vim Dockerfile
FROM ubuntu:14.04

# Install Python Setuptools
RUN apt-get install -y python-setuptools

# Install pip
RUN easy_install pip

# Add and install Python modules
ADD requirements.txt /src/requirements.txt
RUN cd /src; pip install -r requirements.txt

# Bundle app source
ADD . /src

# Expose
EXPOSE  5000

# Run
CMD ["python", "/src/"]
$ docker build -t eb-py-sample .
$ docker run -d \
     -e APP_CONFIG=application.config.example \
     -p 8080:5000 \

Then open http://localhost:8000 to see your own app.