-
-
Save fernandopetry/03996d9cc51223a70459c90ed37b79fe to your computer and use it in GitHub Desktop.
Install Docker on Linux Mint 17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
# Install docker | |
sudo apt-get update | |
sudo apt-get purge lxc-docker | |
sudo apt-get install linux-image-extra-$(uname -r) | |
sudo apt-get install docker-engine | |
sudo service docker start | |
# Modificando para o docker não pedir o sudo | |
sudo usermod -aG docker $USER | |
sudo gpasswd -a $USER docker | |
# Executando uma imagem | |
sudo docker run -d -p 8080:80 -p 330633:3306 tutum/lamp | |
sudo docker run -i -d -p 8080:80 ubuntu:16.04 | |
# Mapeando volume | |
sudo docker run -i -d -p 8080:80 -v $(pwd):/var/www/html ubuntu:16.04 | |
# Nomeando um container | |
sudo docker run --name nome_meu_container -it fernandopetry/phalcon:v1 bash | |
# Gerar uma nova imagem | |
sudo docker build -t woliveiras/nginx . | |
# Subindo a imagem para o Docker Hub | |
docker login | |
docker push nome_da_imagem | |
docker push woliveiras/nginx | |
# Entrando no ssh da maquina | |
sudo docker exec -i -t ae878f6bdb11 /bin/bash | |
# Remover imagem local | |
sudo docker rmi ID_ou_nome_da_imagem | |
# Criar imagem apartir de um container | |
docker stop containercriado | |
docker commit containercriado meuubuntu:nginx | |
# Ubuntu | |
apt-get install software-properties-common | |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install -y apache2 | |
sudo ufw allow in "Apache Full" | |
apt install -y php7.1 libapache2-mod-php7.1 php7.1-curl php7.1-gd php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-xml php7.1-xmlrpc php7.1-phalcon php7.1-imagick php7.1-memcache php7.1-memcached | |
# ============================= START DOCKER ========================== | |
docker run -d \ | |
-it \ | |
-p 8080:80 \ | |
--name=movida \ | |
--net host \ | |
-v /var/www/html/movida:/var/www/html \ | |
fernandopetry/phalcon:v1 | |
Fontes: | |
https://woliveiras.com.br/posts/Criando-uma-imagem-Docker-personalizada/ | |
http://techfree.com.br/2016/03/criando-sua-propria-imagem-docker/ | |
https://woliveiras.com.br/posts/comandos-mais-utilizados-no-docker/ | |
https://www.eduardomedeiros.me/docker-comandos/ | |
https://www.mundodocker.com.br/montando-volumes-docker/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment