Docker · Arazzo Workflow

Docker Create a Network and Attach a Container

Version 1.0.0

Create a user-defined bridge network, create a container, connect it with an alias, start it, and verify the attachment.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CloudContainersDevOpsInfrastructureMicroservicesArazzoWorkflows

Provider

docker

Workflows

provision-network-and-attach
Create a user-defined network and attach a new container to it under an alias.
Creates a named bridge network, creates a container from the supplied image, connects the container to the network with a DNS alias, starts it, and inspects the network to verify the container appears in its container list.
5 steps inputs: containerName, driver, image, internal, networkAlias, networkName outputs: containerId, containers, networkId
1
createNetwork
Create the user-defined network. Unlike the default bridge, a user-defined network gives attached containers automatic DNS resolution of each other by name and alias.
2
createContainer
Create the container that will join the network. It is created but not yet started, so the network attachment can be made before the workload comes up.
3
connectToNetwork
Attach the container to the network under a DNS alias, so peers can resolve it by that alias rather than by container name alone.
4
startContainer
Start the container now that it is attached, so it comes up already resolvable on the network.
5
verifyAttachment
Inspect the network in verbose mode to confirm the container appears in its attached container list with an allocated IP address.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Docker Create a Network and Attach a Container
  summary: Create a user-defined bridge network, create a container, connect it with an alias, start it, and verify the attachment.
  description: >-
    The flow behind multi-container service discovery. A user-defined network is
    what gives containers DNS resolution of each other by name or alias, which the
    default bridge does not provide. This workflow creates the network, creates a
    container, connects it with a network alias, starts it, and then inspects the
    network to confirm the container is really attached. Every step spells out its
    request inline so the flow can be read and executed without opening the
    underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: containerApi
  url: ../openapi/docker-container-api-openapi.yml
  type: openapi
- name: networkApi
  url: ../openapi/docker-network-api-openapi.yml
  type: openapi
workflows:
- workflowId: provision-network-and-attach
  summary: Create a user-defined network and attach a new container to it under an alias.
  description: >-
    Creates a named bridge network, creates a container from the supplied image,
    connects the container to the network with a DNS alias, starts it, and
    inspects the network to verify the container appears in its container list.
  inputs:
    type: object
    required:
    - networkName
    - image
    - containerName
    properties:
      networkName:
        type: string
        description: Name of the user-defined network to create (e.g. "app_net").
      driver:
        type: string
        description: Network driver to use — "bridge" for single host, "overlay" for swarm.
      image:
        type: string
        description: Image to create the container from. It must already be present locally.
      containerName:
        type: string
        description: Name to assign to the created container.
      networkAlias:
        type: string
        description: DNS alias other containers on the network will use to reach this one.
      internal:
        type: boolean
        description: Restrict external access to the network.
  steps:
  - stepId: createNetwork
    description: >-
      Create the user-defined network. Unlike the default bridge, a user-defined
      network gives attached containers automatic DNS resolution of each other by
      name and alias.
    operationId: NetworkCreate
    requestBody:
      contentType: application/json
      payload:
        Name: $inputs.networkName
        Driver: $inputs.driver
        Internal: $inputs.internal
        Labels:
          com.apievangelist.workflow: provision-network-and-attach
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      networkId: $response.body#/Id
      warning: $response.body#/Warning
  - stepId: createContainer
    description: >-
      Create the container that will join the network. It is created but not yet
      started, so the network attachment can be made before the workload comes up.
    operationId: ContainerCreate
    parameters:
    - name: name
      in: query
      value: $inputs.containerName
    requestBody:
      contentType: application/json
      payload:
        Image: $inputs.image
        AttachStdout: true
        AttachStderr: true
        Tty: false
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      containerId: $response.body#/Id
  - stepId: connectToNetwork
    description: >-
      Attach the container to the network under a DNS alias, so peers can resolve
      it by that alias rather than by container name alone.
    operationId: NetworkConnect
    parameters:
    - name: id
      in: path
      value: $steps.createNetwork.outputs.networkId
    requestBody:
      contentType: application/json
      payload:
        Container: $steps.createContainer.outputs.containerId
        EndpointConfig:
          Aliases:
          - $inputs.networkAlias
    successCriteria:
    - condition: $statusCode == 200
  - stepId: startContainer
    description: >-
      Start the container now that it is attached, so it comes up already
      resolvable on the network.
    operationId: ContainerStart
    parameters:
    - name: id
      in: path
      value: $steps.createContainer.outputs.containerId
    successCriteria:
    - condition: $statusCode == 204
  - stepId: verifyAttachment
    description: >-
      Inspect the network in verbose mode to confirm the container appears in its
      attached container list with an allocated IP address.
    operationId: NetworkInspect
    parameters:
    - name: id
      in: path
      value: $steps.createNetwork.outputs.networkId
    - name: verbose
      in: query
      value: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      containers: $response.body#/Containers
      ipam: $response.body#/IPAM
      scope: $response.body#/Scope
  outputs:
    networkId: $steps.createNetwork.outputs.networkId
    containerId: $steps.createContainer.outputs.containerId
    containers: $steps.verifyAttachment.outputs.containers

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/docker-provision-network-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.