File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1- sudo grep -v httpbin.local /etc/hosts | sudo tee /etc/hosts.mocket
2- export CONTAINER_ID=$( docker compose ps -q proxy)
3- export CONTAINER_IP=$( docker inspect -f ' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CONTAINER_ID )
4- echo " $CONTAINER_IP httpbin.local" | sudo tee -a /etc/hosts.mocket
5- sudo mv /etc/hosts.mocket /etc/hosts
1+ HOSTS=/etc/hosts
2+ MOCKET_HOSTS=/etc/hosts.mocket
3+ HTTPBIN_HOST=httpbin.local
4+
5+ sudo grep -v ${HTTPBIN_HOST} ${HOSTS} | sudo tee ${MOCKET_HOSTS}
6+ CONTAINER_ID=$( docker compose ps -q proxy)
7+ CONTAINER_IP=$( docker inspect -f ' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${CONTAINER_ID} )
8+ echo " ${CONTAINER_IP} ${HTTPBIN_HOST} " | sudo tee -a ${MOCKET_HOSTS}
9+ sudo mv ${MOCKET_HOSTS} ${HOSTS}
You can’t perform that action at this time.
0 commit comments