docker images |
See all available images
|
docker build -t <name> |
Create an image with a pretty name (you must define the
Dockerfile in the folder) |
docker tag <name> username/repository:tag |
This tags an image ready to be sent to a repository
|
docker push username/repository:tag |
Push the image to the remote repository
|
docker search <keyword> |
Search for public repositories
|
containers and are similar to .iso files. They can be for example the image of your app and contain everything needed to run the application.Dockerfile with some docker commands to specify how that image will be created, for example to setup the environment and a BaseImage.
docker-compose.yml file.version: "3"services: web: image: amicheletti/get-started:part1 deploy: replicas: 5 resources: limits: cpus: "0.1" memory: 50M restart_policy: condition: on-failure ports: - "80:80" networks: - webnetnetworks: webnet:docker swarm initdocker stack deploy -c docker-compose.yml <app_name>docker stack ps <app_name>docker stack rm <app_name>docker swarm leave --force
docker run <image> |
Run the image, starting a Container
|
-d |
Run in detached mode (in background)
|
-p 4000:80 |
Maps the port
80 of the image to the host port 4000 |
--rm |
Removes the container when exited
|
docker ps |
List the running containers (you can check container id)
|
docker ps -l |
List all the containers (you can check container id)
|
docker stop <container_id> |
Stop the container
|
image, and consists of the image, an execution environment and a standart set of instructions.
docker swarm init |
Initialize a swarm and become
swarm manager |
docker swarm join |
Join a swarm as
worker |
docker swarm leave --force |
Leaves the current swarm
|
swarm, which are simply several machines (virtual or physical) running a Docker and joined to a cluster.swarm manager, which can issue docker commands normally, and the workers which are only there to provide capacity.
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.