Docker stack: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* https://docs.docker.com/engine/reference/commandline/stack/
=Internal=
=Internal=


* [[Docker_Concepts#Stacks|Docker Concepts - Stacks]]
* [[Docker_Concepts#Stack|Docker Concepts - Stacks]]
* [[Docker_Client_Operations#Commands|Docker Client Operations]]
* [[Docker_Client_Operations#Commands|Docker Client Operations]]


Line 7: Line 11:


  docker stack --orchestrator kubernetes <''command''>
  docker stack --orchestrator kubernetes <''command''>
=Commands=
==ls==
List stacks.
docker stack ls
==ps==
List the tasks in the specified stack.
==deploy==
Deploy a new stack or update an existing stack.
docker stack deploy -c ./docker-compose-test.yml --namespace default test-stack
Example of a specification file that deploys PostgreSQL:
<syntaxhighlight lang='yaml'>
---
version: '3.7'
volumes:
  pg-db:
services:
  pg:
    image: mdillon/postgis:9.6
    ports:
      - "5432:5432"
    volumes:
      - "pg-db:/var/lib/postgresql/data"
</syntaxhighlight>
==services==
List the services in the stack.
==rm==
Remove one or more stacks.
docker stack rm test-stack


=Examples=
=Examples=


  docker stack ps --namespace ''namespace-name'' ''stack-name''
  docker stack ps --namespace ''namespace-name'' ''stack-name''

Latest revision as of 22:20, 9 August 2019

External

Internal

Overview

docker stack --orchestrator kubernetes <command>

Commands

ls

List stacks.

docker stack ls

ps

List the tasks in the specified stack.

deploy

Deploy a new stack or update an existing stack.

docker stack deploy -c ./docker-compose-test.yml --namespace default test-stack

Example of a specification file that deploys PostgreSQL:

---
version: '3.7'
volumes:
  pg-db:
services:
  pg:
    image: mdillon/postgis:9.6
    ports:
      - "5432:5432"
    volumes:
      - "pg-db:/var/lib/postgresql/data"

services

List the services in the stack.

rm

Remove one or more stacks.

docker stack rm test-stack

Examples

docker stack ps --namespace namespace-name stack-name