-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsl comandos.txt
83 lines (58 loc) · 2.23 KB
/
wsl comandos.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cat /etc/os-release
Se versão < 20.10 atualize usando:
sudo apt-get update
sudo apt dist-upgrade
sudo apt install update-manager-core
sudo apt autoremove
sudo do-release-upgrade -d
iptables legadas:
sudo update-alternatives --config iptables
e selecione iptables-legacy
Instalando docker
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo apt-get autoremove
add chave repo oficial docker:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Instalar docker engine:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
teste:
docker --version
docker compose version
adicionando alias "docker-compose",
abra o arquivo da seguinte maneira:
nano ~/.bash_aliases
Adicionar a seguinte linha:
alias docker-compose="docker compose"
salva ctrl x
entao:
source ~/.bash_aliases
teste:
docker-compose version
PERMISSÕES(MUST):
sudo groupadd docker
sudo usermod -aG docker $USER
verifique sua pip list, o flask tem que estar na
mesma versao
PRA SUBIR OS CONTAINERES PELO compose
docker-compose up --build
acessar apps - POST request
curl -X POST -H "Content-Type: application/json" -d '{"a": 2, "b": 3}' http://localhost:5000/expo
curl -X POST -H "Content-Type: application/json" -d '{"a": 2, "b": 3}' http://localhost:5001/expo
GET request
curl http://localhost:5000/expo
curl http://localhost:5001/expo
Comunicação com balanceador
POST:
curl -X POST -H "Content-Type: application/json" -d '{"a": 2, "b": 3}' http://localhost:8000/expo
GET:
curl http://localhost:8000/expo
Para derrubar e levantar container
docker ps -- lista os containeres ON
docker stop <nome_ou_ID_do_contêiner> --derrubar
docker ps -a -- lista os containeres ON e OFF
docker start <nome_ou_ID_do_contêiner> -- starta container