Skip to content

Instantly share code, notes, and snippets.

@axeldeveloper
Last active August 28, 2020 11:38
Show Gist options
  • Save axeldeveloper/ec9685af3670b559844df0d7bef8848b to your computer and use it in GitHub Desktop.
Save axeldeveloper/ec9685af3670b559844df0d7bef8848b to your computer and use it in GitHub Desktop.

utilizando do docker toolbox

desabilitar Hyper-V

https://support.bluestacks.com/hc/pt-br/articles/115004254383-Como-eu-desabilito-o-Hyper-V-no-Windows-

abrir o powershell

lista as VMS

docker version docker info

$ docker -v $ docker-machine ls

cria uma maquina virtual docker

$ docker-machine create --driver virtualbox default

$ docker-machine create default --virtualbox-no-vtx-check

$ docker-machine create -d virtualbox --engine-env HTTP_PROXY=http://axbenites@fazcom:AAAAA@[email protected]:8080 -engine-env HTTPS_PROXY=https://axbenites@fazcom:AAAAA@[email protected]:8080 --engine-env NO_PROXY=example2.com default

Docker is up and running! docker-archive-public/docker.machine#4271

Regerando certificado

$ docker-machine regenerate-certs default

Start and stop machines

$ docker-machine stop default $ docker-machine start default Starting VM...

About to remove baz

docker-machine rm baz

IP - PROXY

$ docker-machine ip $ docker-machine ssh docker-machine env default

Connect your shell to the new machine.

$ eval "$(docker-machine env default)"

docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2

docker-compose -f docker-compose.yml build

docker-compose -f docker-compose.yml up -d

docker run -e ELASTIC_PASSWORD=7589632 docker.elastic.co/elasticsearch/elasticsearch-platinum:6.2.4

Environment="HTTP_PROXY=http://axbenites@fazcom:AAAAA@[email protected]:8080"

sudo HTTP_PROXY=HTTP_PROXY=http://axbenites@fazcom:AAAAA@[email protected]:8080/ docker pull docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2

docker-machine create -d virtualbox
--engine-env HTTP_PROXY=http://example.com:8080
--engine-env HTTPS_PROXY=https://example.com:8080
--engine-env NO_PROXY=example2.com
default

mnt/sda1/var/lib/docker

DENTRO DO DOCKER

  • INFORMAÇÕES DE REDE cat /etc/resolv.conf

$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf

$ sudo mkdir -p /etc/systemd/system/docker.service.d

escreve


echo -e "[Service]\nEnvironment="HTTP_PROXY=http://axbenites@fazcom:AAAAA@[email protected]:8080/\"" > /etc/systemd/system/docker.service.d/https-proxy.conf

reinicia

sudo /etc/init.d/docker restart

Missing proxy configuration?

mkdir -p /etc/systemd/system/docker.service.d nano /etc/systemd/system/docker.service.d/http-proxy.conf

[Service] Environment="HTTP_PROXY=http://USER:PASSWD@SERVER:PORT/" Environment="HTTPS_PROXY=http://USER:PASSWD@SERVER:PORT/"

systemctl daemon-reload systemctl restart docker

. https://docs.docker.com/toolbox/faqs/troubleshoot/#/http-proxies-and-connectivity-errors Use ssh to log in to the virtual machine. This example logs in to the default machine.

 $ docker-machine ssh default
 docker@default:~$ sudo vi /var/lib/boot2docker/profile

Add a NO_PROXY setting to the end of the file similar to the example below.

 # replace with your office's proxy environment
 export "HTTP_PROXY=http://PROXY:PORT"
 export "HTTPS_PROXY=http://PROXY:PORT"
 # you can add more no_proxy with your environment.
 export "NO_PROXY=192.168.99.*,*.local,169.254/16,*.example.com,192.168.59.*"

Restart Docker.

After you modify the profile on your VM, restart Docker and log out of the machine.

 docker@default:~$ sudo /etc/init.d/docker restart
 docker@default:~$ exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment