Skip to content

Instantly share code, notes, and snippets.

View caliburn1994's full-sized avatar

Chen Xiaojie caliburn1994

  • Japan
View GitHub Profile
@kojiwell
kojiwell / docker-shared-nw.md
Last active May 12, 2020 04:15
This is how to create a bridge between Docker containers and outside and create containers with the IP addresses you want to assign.

Docker - Create a Bridge and Shared Network

Sometimes I want to use Docker containers like regular VMs, creating a bridge on a Docker host, having containers on the same subnet with IP addresses I want to assign, and then logging into them via port 22. (No port forwarding, please.) So here's how to do it.

On this example, I use Vagrant and VirtualBox on my MacBook and create containers with IP addresses shown on the table below. Once you go through these steps, you should be able to extend the idea into your on-premises network.

@reikind
reikind / gist:4072830
Created November 14, 2012 15:39
Example bash getopts
#!/bin/bash
usage() {
cat << EOT
usage $0 [-hgw]
$0 -m MESSAGE
OPTIONS