Created
March 7, 2019 00:22
-
-
Save RanKey1496/252dafcbb69d344f70e8059444f46f9b to your computer and use it in GitHub Desktop.
Docker swarm tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# error from daemon in stream: Error grabbing logs: rpc error: code = Unknown desc = warning: incomplete log stream. some logs could not be retrieved for the following reasons: node xxx is not available | |
docker swarm ca --rotate | |
# list docker swarm nodes with labels | |
docker node ls -q | xargs docker node inspect \ | |
-f '{{ .ID }} [{{ .Description.Hostname }}]: {{ .Spec.Labels }}' | |
# list docker swarm nodes with IPs | |
for NODE in $(docker node ls --format '{{.Hostname}}'); \ | |
do echo -e "${NODE} - $(docker node inspect --format '{{.Status.Addr}}' "${NODE}")"; done | |
# show task of a service | |
docker service ps {service_name} | |
# use a existing network | |
# In the stack.yml declare the existing network like this | |
networks: | |
example: | |
external: true | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment