docker iptables

http://blog.pulipuli.info/2011/07/ http://linux.vbird.org/linux_server/0250simple_firewall.php iptables \[-AI 鏈\] \[-io 網路介面\] \[-p tcp,udp\] \\ \> \[-s 來源IP/網域\] \[--sport 埠口範圍\] \\ \> \[-d 目標IP/網域\] \[--dport 埠口範圍\] -j \[ACCEPT|DROP|REJECT\] 選項與參數: \--sport 埠口範圍:限制來源的埠口號碼,埠口號碼可以是連續的,例如 1024:65535 \--dport 埠口範圍:限制目標的埠口號碼。 \[root@www ~\]# iptables -A INPUT \[-m state\] \[--state 狀態\] 選項與參數: \-m :一些 iptables 的外掛模組,主要常見的有: state :狀態模組 mac :網路卡硬體位址 (hardware address) \--state :一些封包的狀態,主要有: INVALID :無效的封包,例如資料破損的封包狀態 ESTABLISHED:已經連線成功的連線狀態; NEW :想要新建立連線的封包狀態; RELATED :這個最常用!表示這個封包是與我們主機發送出去的封包有關 範例:只要已建立或相關封包就予以通過,只要是不合法封包就丟棄 \[root@www ~\]# iptables -A INPUT -m state \\ \> \--state RELATED,ESTABLISHED -j ACCEPT \[root@www ~\]# iptables -A INPUT -m state --state INVALID -j DROP https://www.

繼續閱讀

docker csf

https://meta.discourse.org/t/applying-docker-discourse-iptables-rules-when-using-csf-firewall/70531/5 csf v12.08 NOTE: This feature is currently in BETA testing, so may not work correctly This section provides the configuration of iptables rules to allow Docker containers to communicate through the host. If the generated rules do not work with your setup you will have to use a /etc/csf/csfpost.sh file and add your own iptables configuration instead 1 to enable, 0 to disable

繼續閱讀

https://gist.github.com/javahippie/efee5417c69aaad3baf297dd2cd71fc6 version: '3.3' services: go-ethereum: build: context: go-ethe/ ports: - "8545:8545" - "30303:30303" networks: - elk networks: elk: driver: bridge FROM ubuntu:xenial RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/* WORKDIR "/opt" ARG BINARY="geth-linux-amd64-1.8.17-8bbe7207.tar.gz" RUN wget "https://gethstore.blob.core.windows.net/builds/$BINARY" RUN tar -xzvf $BINARY --strip 1 RUN rm $BINARY ADD ./genesis.json ./genesis.json RUN ./geth init genesis.json CMD nohup ./geth --dev --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --mine #geth --syncmode "light" --cache=2048 EXPOSE 8545 EXPOSE 30303

繼續閱讀

1、Get key Key Path c:\user\xxxooo\.docker\machine\machines\%%%%% xxxooo user %%%%% machine name id_rsa This is key 2、Need vm ip、id_rsa Get IP: 1. docker-machine ssh %%%%% 2. ifconfig If need PPK:winscp can auto change id_rsa to ppk 3、last step login VM account:docker =========== https://github.com/boot2docker/boot2docker Docker Machine auto logs in using the generated SSH key, but if you want to SSH into the machine manually (or you’re not using a Docker Machine managed VM), the credentials are:

繼續閱讀

Suggestion is use docker-machine for make docker machine is more easy. VirtualBox windows Use HFS.exe for copy file to docker machine instance. Directory < ethtest > ||=docker-compose.yml ||=< go-ether > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp||=Dockerfile &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp||=start.sh &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp||=< genesis > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp||=genesis.json 1、docker-compose.yml import: .keystore maybe no use, because run again docker-compose need to delete /go-ether/keystore .entrypoint must have together Dockerfile ENTRYPOINT ` version: '3.3' services: go-ether: build: context: go-ether/ volumes: #- ./go-ether/keystore:/root/.ethereum/devchain/keystore:rw - ./go-ether/genesis/genesis.json:/root/genesis/genesis.json:ro - /etc/localtime:/etc/localtime:ro entrypoint: /root/start.

繼續閱讀

$@ linux shell

http://jyhshin.pixnet.net/blog/post/39349999-shell-script-%E8%87%AA%E5%8B%95%E5%AE%9A%E7%BE%A9%E7%9A%84%E8%AE%8A%E6%95%B8 $@ 包含所有輸入的參數,$@ 即代表 $1, $2,….直到所有參數結束。$@ 用將所有參數以空白為間隔,存在 $@ 中。也就是說 $@ 代表了 “$1” “$2” “$3”….。

繼續閱讀

https://github.com/ethereum/go-ethereum/wiki/Private-network https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8-go-ethereum-1-6-clique-poa-consensus-%E5%BB%BA%E7%AB%8B-private-chain-1-4d359f28feff https://blog.fukuball.com/ethereum-%E9%96%8B%E7%99%BC%E7%AD%86%E8%A8%98-22geth-%E5%9F%BA%E7%A4%8E%E7%94%A8%E6%B3%95%E5%8F%8A%E6%9E%B6%E8%A8%AD-muti-nodes-%E7%A7%81%E6%9C%89%E9%8F%88/ https://medium.com/@javahippie/building-a-local-ethereum-network-with-docker-and-geth-5b9326b85f37 https://mshk.top/2017/11/go-ethereum-1-7-2/ https://www.tiny-calf.com/2018/02/01/GETH%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/ https://neighborhood999.github.io/2018/09/19/running-ethereum-on-docker/ https://github.com/yutianwu/ethereum-docker https://github.com/yutianwu/ethereum-docker

繼續閱讀

作者的圖片

Sue boy

Sueboy Can support You

CIO

Taiwan