https://gist.github.com/garystafford/f0bd5f696399d4d7df0f
docker exec -it $(docker container ls | grep 'pattern' | awk '{print $1}') bin/bash docker ps -a --no-trunc | grep 'pattern' | awk '{print $1}' | xargs -r --no-run-if-empty docker rm docker images -a | grep 'pattern' | awk '{print $3}' | xargs docker rmi ############################################################################### # Helpful Docker commands and code snippets ############################################################################### ### CONTAINERS ### docker stop $(docker ps -a -q) #stop ALL containers docker rm -f $(docker ps -a -q) # remove ALL containers docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter # exec into container docker exec -it $(docker container ls | grep '' | awk '{print $1}') sh # exec into container on windows with Git Bash winpty docker exec -it $(docker container ls | grep '' | awk '{print $1}') sh # helps with error: 'unexpected end of JSON input' docker rm -f $(docker ps -a -q) # Remove all in one command with --force docker exec -i -t "container_name_here" /bin/bash # Go to container command line # to exit above use 'ctrl p', 'ctrl q' (don't exit or it will be in exited state) docker rm $(docker ps -q -f status=exited) # remove all exited containers ### IMAGES ### # list images and containers docker images | grep "search_term_here" # remove image(s) (must remove associated containers first) docker rmi -f image_id_here # remove image(s) docker rmi -f $(docker images -q) # remove ALL images!
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
node 1
node 2
signer 1
signer 2
all private key & address create by https://vanity-eth.tk/
check again private key & address by https://www.myetherwallet.com/#view-wallet-info
node1
private key:138cbbfb21686ddc3b5ffeb2cfc83491175af68319977acb81d0ae93392c626c
account address:e79d33e93bd888b35e055f1a12d876354729037b
node2
private key:df0c39faccd3c9d6d10091932f2214b9d42e92bd07b64a1552d13d39a6a84122
account address:Bf95EAacf10BEA53f0a73955a7eFCE2fb4A4Ef1d
signer1
nodekeyhex:fcc406a7344690f66c757cc2c9987e3e78bb01e33229f9877d48a7fecc2d6657
node address:256330933851d6d3c5f7326b01021553415a33cd5485e23bfbe35f6321e6e2f8373bb1c94933fdb3283a1a8b2b737587dd99c555029e65e173a3094daa39277c
private key:d05bd152f3d71ff5f91830f3ccc1090fb670c7026ebf8c2136d4e5090d59398d
account address:5921a4C1B13afbD4b61d63e9c7BD47741C47B176
signer2
private key:df504d175ae63abf209bad9dda965310d99559620550e74521a6798a41215f46
account address:8Cc5A1a0802DB41DB826C2FcB72423744338DcB0
docker-compose
version: '3.3' services: go-ethereum-node1: build: context: go-ethereum-node1/ volumes: #- ./go-ethereum/keystore:/root/.ethereum/devchain/keystore:rw - ./go-ethereum-node1/genesis/poa_for_dev.json:/root/genesis/poa_for_dev.json:ro - /etc/localtime:/etc/localtime:ro #- ./go-ethereum/log:/root/log:rw entrypoint: /root/start.sh ports: - "18545:8545" - "30313:30303" - "30313:30303/udp" networks: - fastdev go-ethereum-node2: build: context: go-ethereum-node2/ volumes: - .
docker-compose.yml
version: '3.3' services: ethereum_etl: build: context: . volumes: - ./var/log/:/ethereum-etl/output:rw #- /root/go/src/github.com/ethereum/go-ethereum/build/bin/data:/ethereum-etl/ipc #failed ipc is interface not data networks: - etl networks: etl: driver: bridge DOCKERFILE
FROM python:3.6-alpine MAINTAINER Eric Lim ENV PROJECT_DIR=ethereum-etl RUN mkdir /$PROJECT_DIR WORKDIR /$PROJECT_DIR RUN apk add --no-cache gcc musl-dev #for C libraries: RUN pip install --upgrade pip && pip install ethereum-etl #ENTRYPOINT ["python", "ethereumetl"] ENTRYPOINT ["ethereumetl"] CMD ["export_all", "-s", "0", "-e", "500000", "-p", "http://xxx.
http://sueboy.blogspot.com/2018/11/docker-iptables_12.html
sudo iptables -vnL
======NAT=====
sudo iptables -t nat -vnL
顯示行數
sudo iptables -t nat -L POSTROUTING -n –line-numbers
-D 刪除那行
sudo iptables -t nat -D POSTROUTING x x is which line delete
確認docker網段補上
sudo iptables -t nat -A POSTROUTING -s 172.19.0.0/16 ! -o docker0 -j MASQUERADE
https://www.centos.bz/2018/02/%E5%AE%9A%E5%88%B6entrypoint%E8%87%AA%E5%8A%A8%E4%BF%AE%E6%94%B9docker%E4%B8%ADvolume%E7%9A%84%E6%9D%83%E9%99%90/
……….
Other way
1、make shell and run shell, before run docker-compose.
mkdir ./data sudo chown docker ./data #sudo chown user01 ./data sudo chmod g+rwx ./data sudo chgrp 994 ./data Directory exist and correct Access. 994 or 50 or 1000 see /etc/passwd or /etc/group
2、But sometime OS install docker by you don’t know way… maybe have user dockerroot、group dockerroot or only group docker
you maybe already run sudo usermod -a -G docker $(whoami) 100% in docker group.
docker & docker-compose 一堆坑
FROM alpine
RUN apk –no-cache upgrade
RUN apk update &&\
apk add bash
Use chown 1000 xxxoo xxxooo file name
logtest: build: context: logtest/ volumes: - ./logtest/logs:./logs:rw networks: - elk command: | /bin/sh -c '/bin/sh -s << EOF echo "Start filebeat...." filebeat run -c ./filebeat.yml -v & sleep 2 while [ ! -f ./logs/filebeat ] do sleep 2 done chown 1000 ./logs/filebeat tail -f /dev/null EOF'