-
Deploy rápidos em menores unidades.
-
Uso menor de recursos.
-
Maior capacidade em um mesmo host.
-
Automatizações mais rápidas.
-
Portabilidade.
-
Isolado
-
Inicio imediato
-
Leves
-
Ideal para terafas curtas
-
Um open source container runtime.
-
Suporte para Mac, Windows & Linux.
-
Command line tool (CLI).
-
Arquivo para construri os containers "Dockerfile".
-
Windows deixa rodar containers Windows and Linux.
-
Repositorio centralizado de containers
-
GitHub para Containers
-
Docker Hub
-
Cloud Providers tambem tem seus próprios Registros de Containers
-
Gerenciar
-
Infrastructure
-
Containers
-
Deployment
-
Scaling
-
Failover
-
Health monitoring
-
App Upgrades, Zero-Downtime deployments
-
-
Escolha entre a grande variedades
- Kubernets, Swarm, Service Fabric
É Necessario instalar o dockers engine atraves do link:
Install Docker Engine | Docker Documentation
Obs: No Windows é preferivel usar o WSL (Windows subsystem for Linux).
docker cli | |
---|---|
docker version | Display the system's version |
docker login | Log in to a Docker registry |
docker info | Display system information |
docker pull [imageName] | Pull an image from a registry |
docker run [imageName] | Run containers |
docker run -d [imageName] | Detached mode |
docker start [containerName] | Start stopped containers |
docker ps | List runnig containers |
docker ps -a | List running and stopped containers |
docker stop [containerName] | Stop containers |
docker kill [containerName] | Kill containers |
docker image inspect [imageName] | Get image info |
#pull and run an nginx server
docker run --publish 80:80 --name webserver nginx
#list the running containers
docker ps
#stop the container
docker stop webserver
#remove the container
docker rm webserver
Docker attach shell | |
---|---|
docker run -it -- /bin/bash | Attach shell |
docker run -it -- microsoft/powershell:nanoserver | Attach Powershell |
docker container exec -it [containerName] -- bash | Attach to a running containe |
docker | |
---|---|
docker rm [containerName] | Removes stopped containers |
docker rm $(docker ps -a -q) | Removes all stopped containers |
docker images | Lists images |
docker rmi [imageName] | Deletes image |
docker system prune -a | Remove all images not in use by any container |
docker | |
---|---|
docker build -t [name:tag] . | Builds an image using Dockerfile located in the same folder |
docker build -t [name:tag] -f | Build an image using a Dockerfile located in a different folder |
docker tag [imageName] [name:tag] | Tag an existing image |
FROM nginx:alpine
COPY . /usr/share/nginx/html
FROM alpine
RUN apk add -update nodejs nodejs-npm
COPY . /src
WORKDIR /src
RUN npm install
EXPOSE 8080
ENTRYPOINT ["node", "./app.js"]
docker tag => Create a target image
-
name:tag
- myimage:v1
-
repository/name:tag
- myacr.azurecr.io/myimage:v1
git clone https://github.com/juliano-pinheiro-martinello/docker
cd /docker
docker build -t image-test .