mirage is reverse proxy for docker container and container manager.
mirage can launch and terminate docker container and serve http request with specified subdomain. Additionaly, mirage passes variable to Dockerfile using environment variables.
- Setup mirage and edit configuration (see Setup section for detail.)
- Run mirage.
Following instructions use below settings.
host:
webapi: docker.dev.example.net
reverse_proxy_suffix: .dev.example.net
listen:
HTTP: 80
Prerequisite: you should resolve *.dev.example.net
to your docker host.
- Launch docker container using curl.
curl http://docker.dev.example.net/api/launch \
-d subdomain=cool-feature \
-d branch=feature/cool \
-d image=myapp:latest
-
Now, you can access to container using "http://cool-feature.dev.exmaple.net/".
-
Terminate container using curl.
curl http://docker.dev.example.net/api/terminate \
-d subdomain=cool-feature
- Access to mirage web interface via "http://docker.dev.example.net/".
- Press "Launch New Container".
- Fill launch options.
- subdomain: cool-feature
- branch: feature/cool
- image: myapp:latest
- Now, you can access to container using "http://cool-feature.dev.exmaple.net/".
- Press "Terminate" button.
Mirage now supports custom parameter. Write your parameter on config.yml.
Mirage contains default parameter "branch" as below.
parameters:
- name: branch
env: GIT_BRANCH
rule: ""
required: true
You can add custom parameter. "rule" option is regexp string.
- Download binary or
go get
- Rename
config_sample.yml
toconfig.yml
- Edit
config.yml
to your environment - Change your domain setting to fit your
config.yml
- Run
mirage
The MIT License (MIT)
(c) 2014 acidlemon. (c) 2014 KAYAC Inc.