Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Hoàn thành Docker Cli

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Show

CLIS quản lý container

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Kiểm tra container

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Tương tác với container

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Lệnh quản lý hình ảnh

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Lệnh chuyển hình ảnh

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Trình tạo các lệnh chính

Hướng dẫn what is a docker cheat sheet? - một bảng gian lận docker là gì?

Docker cli

Quản lý hình ảnh

docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 5

docker build [options] .
  -t "app/container_name"    # name

Tạo một

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
6 từ Dockerfile.

docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 7

docker run [options] IMAGE
  # see `docker create` for options

Chạy một lệnh trong một

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
6.

Quản lý container

docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 9

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars

Thí dụ

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2

Tạo

$ docker exec app_web_1 tail logs/development.log
$ docker exec -t -i app_web_1 rails c
0 từ
docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
6.

$ docker exec app_web_1 tail logs/development.log $ docker exec -t -i app_web_1 rails c 2

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive

Thí dụ

$ docker exec app_web_1 tail logs/development.log
$ docker exec -t -i app_web_1 rails c

Tạo

$ docker exec app_web_1 tail logs/development.log
$ docker exec -t -i app_web_1 rails c
0 từ
docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
6.

$ docker exec app_web_1 tail logs/development.log $ docker exec -t -i app_web_1 rails c 4

docker start [options] CONTAINER
  -a, --attach        # attach stdout/err
  -i, --interactive   # attach stdin

docker stop [options] CONTAINER

Chạy các lệnh trong

$ docker exec app_web_1 tail logs/development.log
$ docker exec -t -i app_web_1 rails c
0.

$ docker exec app_web_1 tail logs/development.log $ docker exec -t -i app_web_1 rails c 6

$ docker ps
$ docker ps -a
$ docker kill $ID

Bắt đầu/dừng một

$ docker exec app_web_1 tail logs/development.log
$ docker exec -t -i app_web_1 rails c
0.

Quản lý $ docker exec app_web_1 tail logs/development.log $ docker exec -t -i app_web_1 rails c 0s bằng PS/KILL.

$ docker exec app_web_1 tail logs/development.log $ docker exec -t -i app_web_1 rails c 8

$ docker images
  REPOSITORY   TAG        ID
  ubuntu       12.10      b750fe78269d
  me/myapp     latest     7b2431a8d968

$ docker images -a   # also show intermediate

Hình ảnh

docker start [options] CONTAINER -a, --attach # attach stdout/err -i, --interactive # attach stdin docker stop [options] CONTAINER 0

Quản lý

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
6s.

Xóa docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 6s.

  • Cũng thấy

Bắt đầu (Docker.io)

Dockerfile

Di sản

docker run [options] IMAGE
  # see `docker create` for options
0

Biến

docker run [options] IMAGE
  # see `docker create` for options
1

docker run [options] IMAGE
  # see `docker create` for options
2

Khởi tạo

docker run [options] IMAGE
  # see `docker create` for options
3

Onbuild

docker run [options] IMAGE
  # see `docker create` for options
4

Lệnh

docker run [options] IMAGE
  # see `docker create` for options
5

Nhập cảnh

Định cấu hình một container sẽ chạy như một thực thi.

Điều này sẽ sử dụng xử lý vỏ để thay thế các biến shell và sẽ bỏ qua bất kỳ đối số dòng lệnh docker start [options] CONTAINER -a, --attach # attach stdout/err -i, --interactive # attach stdin docker stop [options] CONTAINER 2 hoặc docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 7 nào.

docker run [options] IMAGE
  # see `docker create` for options
6

docker run [options] IMAGE
  # see `docker create` for options
7

metadata

  • Xem thêm

docker-compose

https://docs.docker.com/engine/reference/Builder/

docker run [options] IMAGE
  # see `docker create` for options
8

Onbuild

docker run [options] IMAGE
  # see `docker create` for options
9

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
0

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
1

Lệnh

Nhập cảnh

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
2

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
3

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
4

Định cấu hình một container sẽ chạy như một thực thi.

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
5

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
6

Onbuild

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
7

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
8

Lệnh

docker create [options] IMAGE
  -a, --attach               # attach stdout/err
  -i, --interactive          # attach stdin (interactive)
  -t, --tty                  # pseudo-tty
      --name NAME            # name your image
  -p, --publish 5000:5000    # port map
      --expose 5432          # expose a port to linked containers
  -P, --publish-all          # publish all ports
      --link container:alias # linking
  -v, --volume `pwd`:/app    # mount (absolute paths needed)
  -e, --env NAME=hello       # env vars
9

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
0

Nhập cảnh

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
1

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
2

Định cấu hình một container sẽ chạy như một thực thi.

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
3

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
4

Điều này sẽ sử dụng xử lý vỏ để thay thế các biến shell và sẽ bỏ qua bất kỳ đối số dòng lệnh docker start [options] CONTAINER -a, --attach # attach stdout/err -i, --interactive # attach stdin docker stop [options] CONTAINER 2 hoặc docker exec [options] CONTAINER COMMAND -d, --detach # run in background -i, --interactive # stdin -t, --tty # interactive 7 nào.

metadata

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
5

Xem thêm

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
6

https://docs.docker.com/engine/reference/Builder/

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
7

Ví dụ cơ bản

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
8

Tài liệu tham khảo

$ docker create --name app_redis_1 \
  --expose 6379 \
  redis:3.0.2
9

Tòa nhà

Cổng

Biến môi trường

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
0

Phụ thuộc

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
1

Sự lựa chọn khác

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
2

Các tính năng tiên tiến

Nhãn

Máy chủ DNS

Thiết bị

liện kết ngoại

Chủ nhà

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
3

Sevices

docker exec [options] CONTAINER COMMAND
  -d, --detach        # run in background
  -i, --interactive   # stdin
  -t, --tty           # interactive
4

Để xem danh sách tất cả các dịch vụ chạy trong Swarm

Để xem tất cả các dịch vụ đang chạy

Tại sao chúng ta yêu cầu khối lượng cho Docker?

Khối lượng là cách ưa thích để dữ liệu tồn tại trong các container và dịch vụ docker.Một số trường hợp sử dụng cho tập bao gồm: chia sẻ dữ liệu giữa nhiều thùng chứa đang chạy.Nếu bạn không tạo ra nó một cách rõ ràng, một khối lượng được tạo ngay lần đầu tiên nó được gắn vào một thùng chứa.. Some use cases for volumes include: Sharing data among multiple running containers. If you don't explicitly create it, a volume is created the first time it is mounted into a container.

Chính xác thì Docker làm gì?

Docker là một nền tảng nguồn mở cho phép các nhà phát triển xây dựng, triển khai, chạy, cập nhật và quản lý các container, các thành phần có thể thực thi, có thể thực hiện được kết hợp mã nguồn ứng dụng với thư viện hệ điều hành (OS) và các phụ thuộc cần thiết để chạy mã đó trong bất kỳ môi trường nào.enables developers to build, deploy, run, update and manage containers—standardized, executable components that combine application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.

Docker là gì trong các thuật ngữ đơn giản là gì?

Docker là một nền tảng mở để phát triển, vận chuyển và chạy các ứng dụng.Docker cho phép bạn tách các ứng dụng của mình khỏi cơ sở hạ tầng để bạn có thể cung cấp phần mềm nhanh chóng.Với Docker, bạn có thể quản lý cơ sở hạ tầng của mình theo cùng một cách bạn quản lý các ứng dụng của mình.an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.

Các lệnh docker là gì?

Lệnh con.