Docker Hub Container Image Library | App Containerization
percurso de aprendizado docker
💡 Imagensdocker pull alpine:3.6
docker pull alpine:3.7
docker images
docker run -d -p 80:80 nginx
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
docker commit -m "Alpine Python 3" <container> <usuario>/<repo>
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
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