Filipe Brandao edited this page Mar 22, 2017 · 23 revisions

Docker

Docker is an open platform for building, shipping and running applications. Docker allows VPSolver to run on a large variety of platforms with very little effort.

Docker Setup

Install Docker [Docker installation instructions].

Option 1: simply pull VPSolver from the Docker repository (without building):

user@locahost ~$ docker pull fdabrandao/vpsolver

Option 2: clone VPSolver and build locally:

user@locahost ~$ git clone https://github.com/fdabrandao/vpsolver.git vpsolver
user@locahost ~$ docker build -t fdabrandao/vpsolver vpsolver

Usage

Directly using the command line interface:

user@locahost ~$ docker run --rm -it fdabrandao/vpsolver bash
root@55d14f6b6f32:~# source venv2.7/bin/activate # load a virtualenv
(venv2.7)root@55d14f6b6f32:~# python examples/vpsolver/example_vbp.py
...

or through the VPSolver Web App (example URL: http://172.17.0.60:5555/):

user@locahost ~$ docker run --rm -it -p 5555 fdabrandao/vpsolver 
eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:3c  
          inet addr:172.17.0.60  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:acff:fe11:3c/64 Scope:Link
          UP BROADCAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:168 (168.0 B)  TX bytes:180 (180.0 B)

URL: http://172.17.0.60:5555/
 * Running on http://0.0.0.0:5555/
...

Advanced

Run vpsolver in background:

user@locahost ~$ CID=$(docker run -d -p 5555 fdabrandao/vpsolver)
user@locahost ~$ docker inspect --format URL:http://{{.NetworkSettings.IPAddress}}:5555/ $CID
URL:http://172.17.0.71:5555/

List all running vpsolver containers:

user@locahost ~$ docker ps | grep fdabrandao/vpsolver
...

List URLs of all running vpsolver containers:

user@locahost ~$ CIDs=$(docker ps | grep fdabrandao/vpsolver | cut -d" " -f1)
user@locahost ~$ docker inspect --format URL:http://{{.NetworkSettings.IPAddress}}:5555/ $CIDs
...

Stop and remove all vpsolver containers:

user@locahost ~$ docker stop $(docker ps -a | grep fdabrandao/vpsolver | cut -d" " -f1)
user@locahost ~$ docker rm $(docker ps -a | grep fdabrandao/vpsolver | cut -d" " -f1)

Copyright © 2013-2017 Filipe Brandão < fdabrandao@dcc.fc.up.pt >. All rights reserved.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.