This repository is trending on Github since some days now. Watch it, we will add many updates in the future. Thank you for your support.
Check the website.
Прочитать на других языках: English, Russian.
- Установка
- Реестры и репозитории Docker
- Первые действия с контейнерами
- Запуск и остановка контейнеров
- Получение информации о контейнерах
- Сеть
- Очистка Docker
- Docker Swarm
- Заметки
Больше информации здесь
curl -sSL https://get.docker.com/ | sh
Больше информации здесь
Скачайте dmg по этой ссылке.
https://download.docker.com/mac/stable/Docker.dmg
Больше информации здесь
Используйте MSI-инсталлятор:
https://download.docker.com/win/stable/InstallDocker.msi
docker login
docker login localhost:8080
docker logout
docker logout localhost:8080
docker search nginx
docker search --filter stars=3 --no-trunc nginx
docker image pull nginx
docker image pull eon01/nginx localhost:5000/myadmin/nginx
docker image push eon01/nginx
docker image push eon01/nginx localhost:5000/myadmin/nginx
- Запустите образ ubuntu:latest
- Свяжите порт
80
КОНТЕЙНЕРА с портом3000
ХОСТА- Смонтируйте текущую директорию в
/data
на КОНТЕЙНЕРЕ- Заметка: на windows вы должны изменить
-v ${PWD}:/data
на-v "C:\Data":/data
docker container run --name infinite -it -p 3000:80 -v ${PWD}:/data ubuntu:latest
docker container create -t -i eon01/infinite --name infinite
docker container run -it --name infinite -d eon01/infinite
docker container rename infinite infinity
docker container rm infinite
docker container update --cpu-shares 512 -m 300M infinite
docker container start nginx
docker container stop nginx
docker container restart nginx
docker container pause nginx
docker container unpause nginx
docker container wait nginx
docker container kill nginx
docker container kill -s HUP nginx
docker container attach nginx
docker container ls
docker container ls -a
docker logs infinite
docker container logs infinite -f
docker container inspect infinite
docker container inspect --format '{{ .NetworkSettings.IPAddress }}' $(docker ps -q)
docker system events infinite
docker container port infinite
docker container top infinite
docker container stats infinite
docker container diff infinite
docker image ls
docker build .
docker build github.com/creack/docker-firefox
docker build - < Dockerfile
docker build - < context.tar.gz
docker build -t eon/infinite .
docker build -f myOtherDockerfile .
curl example.com/remote/Dockerfile | docker build -f - .
docker image rm nginx
docker image load < ubuntu.tar.gz
docker image load --input ubuntu.tar
docker image save busybox > ubuntu.tar
docker image history
docker container commit nginx
docker image tag nginx eon01/nginx
docker image push eon01/nginx
docker network create -d overlay MyOverlayNetwork
docker network create -d bridge MyBridgeNetwork
docker network create -d overlay \
--subnet=192.168.0.0/16 \
--subnet=192.170.0.0/16 \
--gateway=192.168.0.100 \
--gateway=192.170.0.100 \
--ip-range=192.168.1.0/24 \
--aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \
--aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \
MyOverlayNetwork
docker network rm MyOverlayNetwork
docker network ls
docker network inspect MyOverlayNetwork
docker network connect MyOverlayNetwork nginx
docker container run -it -d --network=MyOverlayNetwork nginx
docker network disconnect MyOverlayNetwork nginx
Используя Dockerfile, вы можете раскрыть порт в контейнере используя:
EXPOSE <port_number>
You can also map порт контейнера to порт хоста используя:
Например,
docker run -p $HOST_PORT:$CONTAINER_PORT --name infinite -t infinite
docker container rm nginx
docker container rm -v nginx
docker container rm $(docker container ls -a -f status=exited -q)
docker container rm `docker container ls -a -q`
docker image rm nginx
docker image rm $(docker image ls -f dangling=true -q)
docker image rm $(docker image ls -a -q)
docker image rm -f $(docker image ls | grep "^<none>" | awk "{print $3}")
docker container stop $(docker container ls -a -q) && docker container rm $(docker container ls -a -q)
docker volume rm $(docker volume ls -f dangling=true -q)
docker system prune -f
docker system prune -a
curl -ssl https://get.docker.com | bash
docker swarm init --advertise-addr 192.168.10.1
docker swarm join-token worker
docker swarm join-token manager
docker service ls
docker node ls
docker service create --name vote -p 8080:80 instavote/vote
docker service ps
docker service scale vote=3
docker service update --image instavote/vote:movies vote
docker service update --force --update-parallelism 1 --update-delay 30s nginx
docker service update --update-parallelism 5--update-delay 2s --image instavote/vote:indent vote
docker service update --limit-cpu 2 nginx
docker service update --replicas=5 nginx
Эта работа впервые была опубликована в Painless Docker Course