We need a global docker network in order to communicate between docker-compose setups on different hosts
Actually, it's a guide to setup docker macvlan network and it can be used to attach static ip to container on public/local network.
- Create docker public network:
docker network create -d macvlan --subnet=$SUBNET --gateway=$GATEWAY_IP -o parent=eth0 public
Where:
$SUBNET - your public network subnet
$GATEWAY_IP - your public network gateway
const EthereumTx = require('ethereumjs-tx'); | |
const _ = require('lodash'); | |
class Wallet { | |
constructor(web3, address, privateKey) { | |
this.web3 = web3; | |
this.address = address; | |
this.privateKey = Buffer.from(privateKey, 'hex'); | |
} |
Platform: Ubuntu 16.04
- It is common practice to create swap that equals to your RAM. So firstly, you should find out your RAM:
free -m
Which outputs like:
total used free shared buff/cache available
- Add docker repo
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
- Update
This guide assumes you've configured your ENI inside linux instance. After you've assigned second ip address to your ENI in the AWS console, you need to reconfigure your interface inside intance.
Assume your interface name: eth1 Assume your second ip: $second_ip From the guide, mentioned above, the content of /etc/network/interfaces.d/eth1.cfg should look like:
auto eth1
iface eth1 inet static
address $your_ip_addr
AMI: ubuntu 16.04
Create and assign ENI
Assume additional interface name: eth1
Assume its private ip: 10.170.224.57
Assume mask: 255.255.0.0 (16)
Inside instance:
Use the delegate instance methods flexibly in class:
require 'forwardable'
class MyHash
extend(Forwardable)
include(Enumerable)