Tool.Yun
개발자를 위한 유용한 도구
CSV에서 JSON으로
JSON Escaper/Unescaper
JSON → CSV 변환
JSON → TOML
JSON → YAML 변환기
JSON 린터
JSON 문자열 변환기
JSON 병합
JSON 비교
JSON 정렬 마스터
JSON 최소화
JSON 쿼리
JSON 크기 분석기
JSON 편집기
JSON 포매터
JSON 플래터너/플래터너 해제
JSON에서 C#로
JSON에서 JS로 변환기
JSON에서 Java 엔티티로
JSON에서 PHP 코드로
JSON에서 Python으로
JSON에서 SQL DDL로
JSON에서 TS로
JSON에서 XML로
JSON에서 스키마로
JSON으로 메시지 팩
JSON으로 이동
JSON을 .env 파일로 변환
JSON을 MessagePack으로
JSON을 객체로
JSON을 데이터로
JS에서 JSON으로 변환기
Jq/JSONPath 테스터
Json에서 PHP 배열로
ObjGen을 JSON으로 변환
PHP-배열을 JSON으로
tools.json-patch.name
HTML을 PDF로 변환
PDF 복호화 및 잠금 해제
PDF 서명 검증기
PDF 선형화/FastWeb
PDF 암호화
PDF 압축기
PDF 연결기
PDF 텍스트 추출기
PDF 페이지 추출기
ObjGen을 HTML로 변환
XML 린터
XML 포매터
XML에서 JSON으로
XPath 테스터
XSLT 테스터
YAML → JSON 변환기
YAML → TOML
YAML 포매터
YAML 플래터너/플래터너 해제
YAML 합병
Epub을 Markdown으로 변환
HTML을 마크다운으로
tools.markdown-format-converter.name
마크다운 TOC 생성기
마크다운 로렘 입숨
마크다운 미리보기
마크다운 차이점
마크다운 테이블 생성기
마크다운 테이블 프리티파이어
마크다운 편집기
마크다운에서 HTML로
마크다운으로 붙여넣기
마크다운을 DOCX로
마크다운을 데이터로 변환
마크다운을 텍스트로 변환
ANSI 탈출 테스터
API 테스트
CLI 명령 편집기
CSS/JS 보기 좋게 정리하고 최소화하기
Django 비밀 생성기
GitIgnore 생성기
Gitattributes 생성기
HEX 파일 변환기
JSON에서 SQL INSERT로
JSON에서 Typescript로
Javascript Unobfuscator/Unpacker
Json에서 Protobuf로
K6 부하 테스트 스크립트 생성기
SQL 매개변수 생성기
SQL 미니파이어
SQL 포매터
Swagger UI 테스터
견적 변환기
데이터 위조범
데이터베이스 생성 빌더
데이터베이스 연결 문자열 작성기
데이터베이스 테이블 생성기
메일토 생성기
스택트레이스가 더 예뻐요
스트링 이스케이퍼
오픈그래프 메타 태그 생성기
자바스크립트 난독화 도구
자바스크립트 프리티파이어
컬 컨버터
코드/스크립트 하이라이터
파비콘 생성기
파일 분할기
포모도로 타이머
피코매치 테스터
크론 표현식 빌더
Cron/주중 알람
ETA 계산기
ICAL 생성기
ICAL 파일 파서
TTL 계산기
iCal 합병
기간 계산기
날짜+기간 계산기
날짜·시간 변환기
시간 알람
시간대 변환기
어느 요일?
일 계산기
주 번호 변환기
카운트다운
크로노미터
ARPA 디코더
Apache LogRotate 생성기
BIMI DNS 생성기
Crontab 생성기
DKIM DNS 생성기
DMARC DNS 생성기
DNS 쿼리
DNSBL 검사기
FStab 생성기
HAS 살균제
HDD 계산기
HTAccess 생성기
Htpasswd/htaccess 생성기
IP 서브넷 제외 계산기
IP 지리적 위치
IPRange/CIDR/IPMask의 IPv4-6/IPRange/CIDR
IPv4 범위 계산기
IPv4 서브넷 계산기
IPv4 서브넷 리스터
IPv4 주소 변환기
IPv4/6 CIDR에서 IP 범위 계산기
IPv4/6 범위 대 CIDR 계산기
IPv6 ULA 생성기
IPv6 서브넷 계산기
IPv6 주소 변환기
MAC 주소 변환기
MAC 주소 생성기
MAC 주소 조회
Nginx 포매터
Option43 생성기
PTR DNS 생성기
RAID 계산기
RAID 안정성 계산기
Rsync 생성기
SIP 인증
SPF DNS 생성기
TCP/UDP 포트 테스터
UFW 명령 생성기
WPA PSK 생성기
Whois 검사기
Wireguard 구성 생성기
X-VR-스팸 원인 디코더
ZPOOL RAID 계산기
ZPool 치트시트
Zxcvbn 비밀번호 강도
chmod 계산기
firewalld 명령줄 생성기
iptables 생성기
tools.restic-command-generator.name
tools.url-redirection-checker.name
기본 인증 헤더 생성기
내 IP 주소
데이터 전송 속도 계산기
랜덤 포트 생성기
마이크 테스터
멀티 링크 다운로더
비밀번호 강도 분석기
비주얼 서브넷 계산기
셸 명령 선형화기
셸 명령어 포맷터
웹소켓 테스트
정수를 IPv4/IPv6로 변환
종료 명령 생성기
컬 명령 생성기
클라우드플레어 DNS/RDAP 쿼리
포트 번호
퓨니코드 변환기
핑
동전 던지기
주사위 롤러
카드 피커
행운의 바퀴
BMI 계산기
IBAN 검증·파서
IES 조명 지침
ISBN 검증기 및 파서
ISO 3166 국가 코드 검색기
ISO 639 검색기
Luhn 검증기
RMB 대문자 변환기
SLA 계산기
Shell 명령어를 설명하세요
달력 변환기
달리기 속도 계산기
부가가치세 번호 검증기
소프트웨어 라이선스 호환성
신용카드 확인기
온라인 사전
유니코드 검색
전화번호 파서/포매터
환율 변환기
Docker Compose 검증기
Docker Compose 형식 변환기
Docker Compose를 .env 파일로
Docker Compose를 Quadlet으로
Docker Compose에서 Docker Run으로 변환기
Docker Compose에서 Kubernetes로
Docker Pangolin 레이블
Docker inspect에서 Docker run으로
Dockerfile 레이블 생성기
Docker에서 Kubernetes로 실행
Docker에서 Quadlet으로 실행
Kubernetes RBAC 생성기
Traefik Docker Compose Maker
docker run → docker-compose 변환기
도커 이미지 다운로더
SI 접두사 변환기
가속 변환기
각도 단위 변환기
길이 단위 변환기
면적 단위 변환기
부피 단위 변환기
속도 변환기
식품 에너지 변환기
압력 단위 변환기
에너지 단위 변환기
온도 변환기
전력 변환기
조도 변환기
주파수 변환기
질량 단위 변환기
체적 유량 변환기
피트니스 컴퓨터
힘 단위 변환기
GTIN 검증기
QR 연락처 정보 생성기
QR 코드 디코더
QR 코드 생성기
WiFi QR 코드 생성기
tools.epc-qrcode-generator.name
바코드 리더
바코드 생성기
BIP39 패스프레이즈 생성기
NanoID 생성기
OTP 코드 생성기
UUID 변환기
UUID 생성기
난수 생성기
누메로님 생성기
다이스웨어 비밀번호 생성기
암호문 생성기
토큰 생성기
핀코드 생성기
16진수 인코더/디코더
ActiveDirectory LDAP 속성 검색기
DMARC 보고서 분석기
DNS 전파 테스터
DNS 테스터
EMV TLV 디코더
ETH 거래 디코더
GZip/Deflate 변환기
HTTPS 테스터
MIME 인코딩 변환기
MongoDB ObjectId 변환기
Nmap 명령 빌더
Outlook MSG 파서
Outlook Safelink 디코더
RJ45 Cat6 배선 요약표
SMART 원시 변환기
Sharepoint 공유 URL 디코더
TCPDump 생성기
URL 빌더
URL 파서
键盘测试器
눈송이 ID 추출기
마루 파일 리더
미들 엔디안 변환기
민감한 데이터 마스커
바운스 이메일 파서
부동 소수점 숫자 변환기
불량 화소 테스터
이메일 파서
저항기 계산기
직렬 포트 콘솔
짧은 URL 확장기
쿠키 파서
키코드 정보
텍스트 문자 집합 감지기/디코더
파일 유형 감지기
Base64 16진수 배열 인코더/디코더
Base64 문자열 인코더/디코더
Base64 파일 변환기
CSV를 데이터로
Env 변수 형식 변환기
Excel에서 데이터로
ULID 생성기
dBm mW 변환기
데이터 저장 장치 변환기
로마 숫자 변환기
속성 변환기
에너지 소비 및 비용 컴퓨터
여러 단위 변환기
유니코드 문자를 Java 엔터티로 변환
이메일 정규화
지리적 좌표 변환기
진수 변환기
텍스트 ↔ ASCII 바이너리
텍스트 ↔ 유니코드
토런트에서 자석으로
삼각함수/방정식 곡선 시각화 도구
수식 계산기
수학 OCR
수학 형식 변환기
이진 계산기
팁 계산기
AGE 암호화
Ansible 볼트 암호 해독
Bcrypt
Bech32 인코더/디코더
CRC 계산기
CSR 생성기
ECDSA 키 쌍 생성기
Ed25519 키 쌍 생성기
HMAC 생성기
JWT 생성기
JWT 파서
Jasypt 문자열 암호화
Niceware 바이트를 암호로
PGP 암호화
PGP 키젠
PGP 파일 암호화
RSA 암호화
RSA 키 페어 생성기
RSA/DSA/ECDSA 서명자 및 검증자
SAML 파서
SSL 인증서 변환기
X509 인증서 생성기
샤미르의 비밀 공유
아르곤2 해셔
인증서/키 파서
텍스트 암·복호화
텍스트 해시
파세토/PASERK 공공/민간
파세토/PASERK 로컬
파일 해셔
CSS XPath 변환기
CSS 그래디언트 생성기
CSS 단위 변환기
CSS 프리티파이어
HTML WYSIWYG 편집기
HTML 엔티티 이스케이프
HTML 축소기
HTML 클리너
HTML 프리티파이어
HTML을 XHTML로 변환
HTML을 데이터로 변환
HTTP 상태 코드
MIME 유형 변환기
REM 픽셀 변환기
SVG 플레이스홀더 생성기
URL 인코더/디코더
URL 캐처
URL 클리너
URL 텍스트 검색 조각 생성기
UTM URL 생성기
User-agent 파서
디바이스 정보
문자열 슬러그화
색상 대비 검사기
색상 변환기
색상환
이미지를 CSS로
EXIF 제거
GIF를 MP4로 변환
HEIC 변환기
ICO/PNG 변환기
SVG 미리보기
워터마커
이미지 EXIF/메타데이터/GPS/JPEG 품질 리더
이미지 배경 제거
이미지 비교
이미지 자르기
이미지 컬러 인버터
이미지 크기 조절
이미지 형식 변환기
이미지를 SVG로(potrace)
이미지와 PDF OCR화
카메라 레코더
상환 계산기
백분율 계산기
벤치마크 빌더
종횡비 계산기
지리적 거리 계산기
Bash 치트시트
CSS 선택자 치트시트
Docker Compose 치트시트
Docker SWARM 치트시트
Docker 치트시트
Dockerfile 치트시트
Git 의미적 커밋 치트시트
Git 치트시트
JSONPath 구문 요약
Jq 치트시트
K8s 치트시트
Nginx 치트시트
PowerShell 치트 시트
Sed 치트시트
Tmux 명령어 치트 시트
VIM 치트시트
XPath 구문 요약
Zellij 명령어 치트 시트
chmod 명령어 요약
나노 치트시트
마크다운 치트 시트
일반 정규식 치트시트
정규식 치트시트
화면 명령어 치트 시트
AI 프롬프트 분할기
AI용 팩 파일
ASCII Art로 이미지 변환
ASCII 아트 텍스트 생성기
GPT 토큰 인코더/디코더
GPT 토큰 추정기
HTML에서 텍스트 추출
I 및 L 체커
JSON에서 TOON으로
Lorem ipsum 생성기
NATO 음성 알파벳 변환
RSVP 독자
Sed 명령 생성기
TOON에서 JSON으로
글꼴 비교
대소문자 변환기
뚜렷한 단어들
레벤슈타인 계산기
룬 변환기
리스트 변환기
모스 부호 변환기
목록 비교
무작위 줄 선택기
문자열 난독화
소셜 링크 공유자
스마트 텍스트 교체 및 줄바꿈
유니코드 포매터
유니코드에서 GSM-7로
이모지 선택기
인어 수출업체
인용 생성기
잘고 생성기/배너
정규식 테스터
중복된 줄 찾기
키보드 레이아웃 변환기
탭 키를 눌러 공백으로 이동
텍스트 번역기
텍스트 비교
텍스트 통계
텍스트를 유니코드 이름으로
폴더 구조 다이어그램
TOML → JSON
TOML → YAML
TOML 린터

Docker SWARM 치트시트

Docker Swarm 모드 치트시트

Docker Swarm mode is Docker’s native clustering and orchestration solution. It turns a group of Docker hosts into a single virtual system with high availability, load balancing and a declarative deployment model — using the CLI you already know.

  • Built-in orchestration with a declarative service model
  • Rolling updates and one-command rollback
  • Self-healing: failed replicas are rescheduled automatically
  • Secure node-to-node communication over mutual TLS, rotated automatically
  • Secrets and configs distributed straight from the cluster store

ℹ️ Swarm does not auto-scale on load. Replica counts are set manually with --replicas or docker service scale.

🧱 Concepts

TermWhat it is
NodeA Docker engine that joined the swarm — a manager or a worker
ManagerKeeps cluster state via Raft, schedules tasks, serves the API
WorkerRuns tasks only; has no view of the cluster state
ServiceThe declaration of what should run (image, replicas, ports, …)
TaskOne container slot of a service, scheduled onto a node
StackA group of services deployed together from a Compose file

📌 Swarm Initialization

# initialize a swarm; this node becomes the first manager
docker swarm init

# pick the interface to advertise on multi-homed hosts
docker swarm init --advertise-addr <manager-ip>

# address pool for the overlay networks
docker swarm init --default-addr-pool 10.20.0.0/16

# print the command a worker needs to join
docker swarm join-token worker

# print the command a manager needs to join
docker swarm join-token manager

# run on the joining node
docker swarm join --token <token> <manager-ip>:2377

# rotate a token, invalidating the old one
docker swarm join-token --rotate worker

# leave the swarm (on a worker)
docker swarm leave

# leave on a manager, or on the last node
docker swarm leave --force

# keep fewer terminated tasks per service
docker swarm update --task-history-limit 5

# lifetime of the node certificates
docker swarm update --cert-expiry 720h

# rotate the swarm certificate authority
docker swarm ca --rotate

🔌 Ports that must be open between nodes

PortProtocolUsed for
2377TCPCluster management (managers only)
7946TCP + UDPNode discovery and gossip
4789UDPOverlay network data plane (VXLAN)
IP protocol 50 (ESP)—Only with encrypted overlay networks

👥 Node Management

# list the nodes of the swarm
docker node ls

# filter by role, id, name, label, membership
docker node ls --filter role=manager

# readable summary of one node
docker node inspect <node> --pretty

# a single field via a Go template
docker node inspect -f '{{.Status.State}}' <node>

# worker  → manager
docker node promote <node>

# manager → worker
docker node demote <node>

# move tasks off and stop scheduling new ones
docker node update --availability drain <node>

# keep running tasks, schedule nothing new
docker node update --availability pause <node>

# bring a drained or paused node back
docker node update --availability active <node>

# label a node for placement constraints
docker node update --label-add env=production <node>

# remove a label again
docker node update --label-rm env <node>

# tasks running on a node
docker node ps <node>

# remove a node that already left
docker node rm <node>

# remove an unreachable node
docker node rm --force <node>

💡 Drain a node before maintenance (--availability drain), then set it back to active. Swarm reschedules the tasks for you.

🧠 Manager Nodes & Raft

Managers orchestrate tasks, maintain the cluster state through Raft consensus and serve the API. Several managers give you high availability, but only one is the leader at a time.

⚠️ Use an odd number of managers (3, 5 or 7). Raft tolerates (N-1)/2 failures — 3 managers survive 1 loss, 5 survive 2. Beyond 7 the consensus overhead outweighs the benefit.

# swarm and Raft state of the local node
docker info

# details of the current node, manager status included
docker node inspect self --pretty

# encrypt the Raft logs at rest
docker swarm update --autolock=true

# unlock a manager after a restart
docker swarm unlock

# show the current unlock key
docker swarm unlock-key

# rotate it
docker swarm unlock-key --rotate

📦 Service Management

# create a service
docker service create --name <service> <image>

# create a service with a fixed replica count
docker service create --name <service> --replicas <n> <image>

# create a global service: one task on every node
docker service create --name <service> --mode global <image>

# list services
docker service ls

# filter the list
docker service ls --filter name=<service>

# readable service definition
docker service inspect <service> --pretty

# tasks and the nodes they run on
docker service ps <service>

# change the replica count
docker service scale <service>=<n>

# scale several services at once
docker service scale <svc-a>=3 <svc-b>=5

# roll out a new image
docker service update --image <new-image> <service>

# redistribute tasks without changing anything
docker service update --force <service>

# go back to the previous definition
docker service rollback <service>

# follow the logs of every task
docker service logs -f <service>

# recent output only
docker service logs --tail 100 --since 10m <service>

# remove a service
docker service rm <service>

Changing a running service

# add or replace an environment variable
docker service update --env-add KEY=value <service>

# remove one
docker service update --env-rm KEY <service>

# publish another port
docker service update --publish-add 8080:80 <service>

# stop publishing it
docker service update --publish-rm 8080 <service>

# attach a volume
docker service update --mount-add type=volume,src=data,dst=/data <service>

# detach it again, by target path
docker service update --mount-rm /data <service>

# add a placement constraint
docker service update --constraint-add 'node.labels.env==prod' <service>

# at most one task per node
docker service update --replicas-max-per-node 1 <service>

# change the resource limits
docker service update --limit-memory 512m --reserve-memory 256m <service>

🔁 Replicas & Modes

Replicas define how many instances of a service run across the swarm. Swarm spreads them over the available nodes and reschedules them when a task or a node fails.

ModeFlagBehaviour
Replicated--mode replicated (default)Run exactly --replicas tasks, anywhere they fit
Global--mode globalExactly one task per eligible node
Replicated job--mode replicated-jobRun --replicas tasks to completion
Global job--mode global-jobRun one task to completion on every node
# five tasks
docker service create --replicas 5 --name myapp myimage

# scale the same service up to ten
docker service scale myapp=10

# one per node
docker service create --mode global --name agent myimage

# batch job: 20 tasks in total, 4 running at a time
docker service create --mode replicated-job --replicas 20 \
  --max-concurrent 4 --name migrate myimage

🐝 Tasks & Containers

A task is a single container slot managed by Swarm; it maps to one container on one node and is never moved — a failed task is replaced by a new one.

# tasks of a service, with their node
docker service ps <service>

# full error messages — start debugging here
docker service ps --no-trunc <service>

# hide the terminated tasks
docker service ps -f "desired-state=running" <service>

# tasks on one node
docker node ps <node>

# containers on the current node
docker container ls

# low-level details of one container
docker container inspect <container-id>
Task stateMeaning
NEW / PENDINGAccepted, waiting for a node that satisfies the constraints
ASSIGNED / PREPARINGSent to a node, image being pulled
STARTING / RUNNINGThe container is starting or up
COMPLETEA job task finished successfully
FAILEDThe container exited with an error
SHUTDOWNStopped on purpose (update, drain, scale down)
REJECTEDThe node refused the task (missing image, bad mount)
ORPHANEDThe node has been unreachable too long

🎯 Placement

docker service create --constraint 'node.role==worker' --name web nginx

docker service create --constraint 'node.labels.env==production' --name api myimage

docker service create --placement-pref 'spread=node.labels.zone' --name web nginx

docker service create --replicas-max-per-node 1 --name web nginx
ExpressionMatches
node.rolemanager or worker
node.hostnameThe node’s hostname
node.idThe node’s ID
node.labels.<key>A label set with docker node update --label-add
engine.labels.<key>A label set in the engine’s daemon.json
node.platform.os / node.platform.archlinux, windows / amd64, arm64

🌐 Networking

An overlay network is a virtual network spanning multiple Docker hosts. Containers on different nodes talk as if they were on the same L2 segment, with DNS-based service discovery built in.

# create an overlay network
docker network create --driver overlay <network>

# encrypt the data plane too
docker network create --driver overlay --opt encrypted <network>

# let standalone containers join
docker network create --driver overlay --attachable <network>

# list networks
docker network ls

# attached services and containers
docker network inspect <network>

# attach at creation time
docker service create --name <service> --network <network> <image>

# attach an existing service
docker service update --network-add <network> <service>

# detach it again
docker service update --network-rm <network> <service>

Publishing ports

# routing mesh (ingress)
docker service create --publish 8080:80 --name web nginx

# host port, no mesh
docker service create --publish mode=host,target=80,published=8080 --name web nginx
ModeBehaviour
ingress (default)Every node accepts the port and load-balances to the tasks
hostThe port is published only on nodes running a task — no mesh, no extra hop

🔄 Rolling Updates & Rollback

docker service create \
  --name web \
  --replicas 5 \
  --update-parallelism 2 \
  --update-delay 10s \
  --update-failure-action rollback \
  --update-monitor 30s \
  nginx:1.25

# trigger the rolling update
docker service update --image nginx:1.26 web

# return to the previous definition
docker service rollback web
FlagDescription
--update-parallelismHow many tasks are updated at once (0 = all)
--update-delayPause between batches
--update-failure-actionpause (default), continue or rollback
--update-monitorHow long a task is watched before it counts as healthy
--update-orderstop-first (default) or start-first
--rollback-parallelismSame knobs for the rollback path (--rollback-delay, --rollback-monitor, --rollback-failure-action, --rollback-order)

🩺 Health Checks

Swarm reschedules a task as soon as its health check fails, so an update never marks a broken image as healthy.

docker service create \
  --name api \
  --health-cmd 'curl -f http://localhost:8080/health || exit 1' \
  --health-interval 10s \
  --health-timeout 3s \
  --health-retries 3 \
  --health-start-period 30s \
  myimage

🔐 Secrets

Secrets are encrypted in the Raft log and mounted into the container as in-memory files under /run/secrets/.

# create from a file
docker secret create db_password ./db_password.txt

# create from stdin
echo "s3cr3t" | docker secret create db_password -

# list secrets
docker secret ls

# metadata only — never the value
docker secret inspect db_password

# attach a secret; it appears at /run/secrets/db_password
docker service create --name db --secret db_password postgres:16

# ...or mount it at a custom path with a fixed mode
docker service create --name db \
  --secret source=db_password,target=/run/secrets/pg_pw,mode=0400 postgres:16

# only possible when no service uses it
docker secret rm db_password

Rotating a secret — create the new one, swap it, then drop the old one:

echo "n3w-s3cr3t" | docker secret create db_password_v2 -

docker service update \
  --secret-rm db_password \
  --secret-add source=db_password_v2,target=db_password \
  db

docker secret rm db_password

🔑 Configs

Configs work like secrets but are not encrypted at rest — use them for non-sensitive files such as nginx.conf.

# create a config
docker config create my_nginx_conf ./nginx.conf

# list configs
docker config ls

# metadata and the stored content
docker config inspect my_nginx_conf

# mount a config at a specific path
docker service create \
  --name web \
  --config source=my_nginx_conf,target=/etc/nginx/nginx.conf \
  nginx

# swap in a new version of the config
docker service update \
  --config-rm my_nginx_conf \
  --config-add source=my_nginx_conf_v2,target=/etc/nginx/nginx.conf \
  web

# only when no service uses it
docker config rm my_nginx_conf

📚 Stacks

A stack is a group of related services deployed together from a Compose file — the standard production workflow for Swarm.

# deploy or update a stack
docker stack deploy -c stack.yaml mystack

# pass your registry credentials along
docker stack deploy -c stack.yaml --with-registry-auth mystack

# remove services no longer in the file
docker stack deploy -c stack.yaml --prune mystack

# list stacks
docker stack ls

# services of a stack
docker stack services mystack

# tasks of a stack
docker stack ps mystack

# tasks of a stack, with full error messages
docker stack ps --no-trunc mystack

# print the merged, resolved file
docker stack config -c stack.yaml

# remove the whole stack
docker stack rm mystack

Stacks honour the deploy: block of the Compose file (replicas, placement, resources, restart policy, update config). build:, top-level restart: and depends_on: are ignored.

🧯 Troubleshooting

# the error column tells you why a task died
docker service ps --no-trunc <service>

# application output of every task
docker service logs --tail 200 <service>

# is a node Down or Unreachable?
docker node ls

# what was actually deployed
docker service inspect --pretty <service>

# live stream of orchestration events
docker events --filter type=service
SymptomUsual cause
Task stuck in PENDINGNo node satisfies the constraints, ports, or resource reservations
no suitable nodePlacement constraint or --replicas-max-per-node cannot be met
Task loops FAILED → STARTINGThe container exits immediately — read docker service logs
REJECTED with an image errorThe image is missing on that node; use --with-registry-auth for private registries
Service unreachable from other nodesPorts 7946/4789 blocked, or the services are not on the same overlay network

🛠 Common Flags Reference

docker service create / docker service update

FlagDescription
--replicasNumber of tasks for a replicated service
--modereplicated (default), global, replicated-job, global-job
--publishPort mapping (<published>:<target>, or mode=host,...)
--mountAttach a volume or bind mount
--networkAttach to an overlay network
--constraintPlacement rule, e.g. node.role==worker
--placement-prefSpread tasks, e.g. spread=node.labels.zone
--replicas-max-per-nodeCap the tasks of this service per node
--limit-cpu / --limit-memoryHard resource limits
--reserve-cpu / --reserve-memoryResources reserved for scheduling
--secret / --configAttach a secret or a config
--env / --env-fileEnvironment variables
--restart-conditionnone, on-failure or any (default)
--health-cmd and friendsOverride the image health check
--with-registry-authForward registry credentials to the nodes

📄 Example: Production-style Web Service

docker service create \
  --name web \
  --replicas 3 \
  --publish 80:80 \
  --network webnet \
  --constraint 'node.role==worker' \
  --constraint 'node.labels.env==production' \
  --placement-pref 'spread=node.labels.zone' \
  --update-parallelism 1 \
  --update-delay 10s \
  --update-failure-action rollback \
  --update-order start-first \
  --limit-memory 512m \
  --reserve-memory 256m \
  --restart-condition any \
  nginx:1.25

📚 Resources

  • Swarm mode overview
  • Swarm services
  • Manage secrets
  • Manage configs
  • Stack file reference (Compose Spec deploy:)
  • docker service create CLI reference