Comandos Docker

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

docker network create --driver bridge node-mongo

docker run -v "C:\Users\Alura\Desktop\volume-exemplo:/var/www" node

docker run -d -p 12345:80 dockersamples/static-site

docker run -d -P --name NOME dockersamples/static-site

#para todos de uma vez


docker stop -t 0 $(docker ps -q)

docker run --name node-project --network node-mongo -d -p 8080:3000 -v


/home/giovani/Documentos/Projetos/node-mongo-treinamento/code:/code node

####Android Studio
docker run --name android-studio --network node-mongo -p 8080:8080 -ti --rm -e
DISPLAY=$DISPLAY
--privileged -v /dev/bus/usb:/dev/bus/usb -v
/home/giovani/Documentos/Projetos/:/projetos -v /tmp/.X11-unix:/tmp/.X11-unix
kelvinlawson/android-studio

####Ionic 2
docker run -i -t -d --name ionic-dev -v
/home/giovani/Documentos/Projetos/:/projects/ionic/ -p 8100:8100 -p 35729:35729
--privileged -v /dev/bus/usb:/dev/bus/usb netizy/ionic-2

#entrar no terminal de um container


docker exec -it 28c959e481bb /bin/bash

#cria link / apelido para função no linux


ln -s /usr/bin/nodejs /usr/bin/node

##################################### Altera id exposto docker


ou can change the port mapping by directly editing the hostconfig.json file
at /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json and
config.v2.json

You can determine the [hash_of_the_container] via the docker inspect


<container_name> command and the value of the "Id" field is the hash.

1) stop the container


2) change the file
3) restart your docker engine (to flush/clear config caches)
4) start the container
So you don't need to create an image with this approach. You can also change the
restart flag here.

P.S. You may visit https://docs.docker.com/engine/admin/ to learn how to


correctly restart your docker engine as per your host machine. I used sudo
systemctl restart docker to restart my docker engine that is running on Ubuntu
16.04

##################################### INSTALAÇÃO NODE UBUNTU - RECOMENDAÇÕES


curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Refer: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-
linux-distributions
##################################### postgres
psql -U postgres
docker run -it --rm postgres psql -U postgres -h ip-of-postgres-container

docker run --name postgres-algar -e POSTGRES_PASSWORD=postgres -d postgres

##################################### xampp
docker run --name xampp -d -v
/home/giovani/Documentos/Get/phaco:/opt/lampp/htdocs -p 80:80 -p 443:443 -p
3306:3306 fuyuanli/xampp

docker run --name my-xampp -d -v


/home/giovani/Documentos/Get/phaco:/opt/lampp/htdocs -p 80:80 -p 443:443 -p
3306:3306 giovanigil/xampp:1.0

EXECUTAR COMANDOS NO BANCO – DOCKER

Restaura
docker exec -i mysql8.0 mysql -uroot -p123456 < ./site-wp-local-2021-10-12.sql

Script
docker exec -i mysql8.0 mysql -uroot -p123456 site_wp < ./dump-wp_br_pt-
202211281124.sql

You might also like