- System
- Image
- Build an imagePOST
- Delete builder cachePOST
- Create a new image from a containerPOST
- Create an imagePOST
- Export several imagesGET
- List ImagesGET
- Import imagesPOST
- Delete unused imagesPOST
- Search imagesGET
- Remove an imageDELETE
- Export an imageGET
- Get the history of an imageGET
- Inspect an imageGET
- Push an imagePOST
- Tag an imagePOST
- Config
- Container
- Create a container
- List containers
- Delete stopped containers
- Remove a container
- Get an archive of a filesystem resource in a container
- Get information about files in a container
- Extract an archive of files or folders to a directory in a container
- Attach to a container
- Attach to a container via a websocket
- Get changes on a container’s filesystem
- Export a container
- Inspect a container
- Kill a container
- Get container logs
- Pause a container
- Rename a container
- Resize a container TTY
- Restart a container
- Start a container
- Get container stats based on resource usage
- Stop a container
- List processes running inside a container
- Unpause a container
- Update a container
- Wait for a container
- Exec
- Distribution
- Network
- Node
- Plugin
- Secret
- Service
- Session (experimental)
- Swarm
- Task
- Volume
- Get task logsGET
Initialize a new swarm
/v1.33
/v1.33
/v1.33
/v1.33
POST
/swarm/init
Swarm
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1.33/swarm/init' \
--header 'Content-Type: application/json' \
--data-raw '{
"AdvertiseAddr": "192.168.1.1:2377",
"ForceNewCluster": false,
"ListenAddr": "0.0.0.0:2377",
"Spec": {
"CAConfig": {},
"Dispatcher": {},
"EncryptionConfig": {
"AutoLockManagers": false
},
"Orchestration": {},
"Raft": {}
}
}'
Response Response Example
200 - Example 1
"7v2t30z9blmxuhnyo6s4cpenp"
Request
Body Params application/json
AdvertiseAddr
stringÂ
optional
192.168.1.1:4567
, or an interface followed by a port number, like eth0:4567
. If the port number is omitted, the port number from the listen address is used. If AdvertiseAddr
is not specified, it will be automatically detected when possible.DataPathAddr
stringÂ
optional
<ip|interface>
), for example, 192.168.1.1
,or an interface, like
eth0
. If DataPathAddr
is unspecified, the same address as AdvertiseAddr
is used.
DataPathAddr
specifies the address that global scope network drivers will publish towards othernodes in order to reach the containers running on this node. Using this parameter it is possible to
separate the container data traffic from the management traffic of the cluster.
ForceNewCluster
booleanÂ
optional
ListenAddr
stringÂ
optional
192.168.1.1:4567
, or an interface followed by a port number, like eth0:4567
. If the port number is omitted, the default swarm listening port is used.Spec
object (SwarmSpec)Â
optional
CAConfig
object  | nullÂ
optional
Dispatcher
object  | nullÂ
optional
EncryptionConfig
objectÂ
optional
Labels
objectÂ
optional
Example:
{"com.example.corp.department":"engineering","com.example.corp.type":"production"}
Name
stringÂ
optional
Example:
default
Orchestration
object  | nullÂ
optional
Raft
objectÂ
optional
TaskDefaults
objectÂ
optional
Examples
Responses
🟢200no error
application/json
Body
stringÂ
optional
Example:
7v2t30z9blmxuhnyo6s4cpenp
🟠400bad parameter
🔴500server error
🔴503node is already part of a swarm
Modified at 2022-09-10 17:56:07