Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Plugin for setting etc/hosts entries within the app container

License

Notifications You must be signed in to change notification settings

alfetopito/dokku-hosts-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hosts Plugin for Dokku

Plugin for setting etc/hosts entries within the app container

Project: https://github.com/progrium/dokku

Warning: This plugin is under development and still only tested with the below dependencies

Useful when needing to set a host to be accessed within one app and for some reason using the IP address is not an option.

For example, when you have another dokku instance running at 199.10.32.3 and you access it via myapp.dokku.me mapped in your dev machine's /etc/hosts file:

# /etc/hosts
199.10.32.3 myapp.dokku.me

Requirements

Only tried with the following so far

  • Docker version 1.5.0 or higher
  • Dokku version 0.3.15 or higher

Installation

cd /var/lib/dokku/plugins
git clone https://github.com/alfetopito/dokku-hosts-plugin/ hosts

No need to install the plugin

Commands

$ dokku help
    hosts:add <app> <ip> <hostname>                 Sets <ip> and <hostname> for <app>
    hosts:list <app>                                Lists all custom hosts set for <app>
    hosts:remove <app> <hostname>                   Removes <hostname> from <app>
    hosts:removeall <app>                           Removes all hosts set for <app>

Simple usage

Make sure your app is running.

Add a ip/hostname to your app's etc/hosts

$ dokku hosts:add myapp 0.0.0.0 myhost.com 

List currently set hosts

$ dokku hosts:list myapp

Advanced usage

Remove one entry

$ dokku hosts:remove myapp myhost.com

Remove all entries

$ dokku hosts:removeall myapp

TODO

  • Set configured hosts to every created app container, not just the ones existing after a deploy #1

About

Plugin for setting etc/hosts entries within the app container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages