Docker Hub Container Image Library | App Containerization
💡 **Antes dos containers**- Performance
- Escalabilidade
- Portabilidade
- Custo
- Segurança
- Habilidades existentes
- Docker para Mac
- Docker para Windows
- Nativo para o Linux
- Docker para AWS
Amazon CloudWatch - Monitoramento de aplicativos e infraestrutura
- Docker para Azure
💡 Microserviços 💡 Docker containers aumentam a flexibilidade e a performance
e4dd70ac-b365-49a1-b138-7c9e81e4672b-6.webp
GitHub - GustavoMazz/workShop_docker
💡 Imagensdocker pull alpine:3.6
docker pull alpine:3.7
docker images
docker run -d -p 80:80 alpine:3.6
docker ps -a
docker export <container> > <filename>.tar
docker import - mynginx < <filename>.tar
docker save -o mynginx1.tar nginx
docker load < mynginx1.tar
docker run -dit alpine sh
docker exec -it /bin/sh
cat /etc/os-release
apk update
apk add --no-cache python3 py3-pip
docker commit -m "Alpine Python 3" <container> <imagem>
docker login
docker push <usuario>/repo
- ADD
- COPY
- CMD
- ENTRYPOINT
- RUN
- WORKDIR
- ENV
💡 Docker Compose!!
version: '2'
services:
mysql:
image: 'bitnami/mariadb'
ports:
- '3306:3306'
environment:
- MARIADB_ROOT_PASSWORD=secret
phpmyadmin:
image: 'phpmyadmin/phpmyadmin'
links:
- mysql
ports:
- '80:80'
environment:
PMA_HOST: mysql
PMA_PORT: 3306
Docker Engine 1.12
Compose file version 3 reference
docker swarm init
docker swarm init --advertise-addr eth0
version: '3'
services:
mysql:
image: 'bitnami/mariadb'
deploy:
mode: replicated
replicas: 2
resources:
limits:
cpus: '0.25'
memory: '512M'
reservations:
cpus: '0.2'
memory: '256M'
networks:
- exemplo_net
environment:
- MARIADB_ROOT_PASSWORD=secret
phpmyadmin:
image: 'phpmyadmin/phpmyadmin'
networks:
- exemplo_net
deploy:
mode: replicated
resources:
limits:
cpus: '0.25'
memory: 512M
reservations:
cpus: '0.25'
links:
- mysql
ports:
- '80:80'
environment:
PMA_HOST: mysql
PMA_PORT: 3306
networks:
exemplo_net:
docker stack deploy --compose-file docker-compose.yml stackdemo
docker service ls
docker ps -a