The Container Resource

Containers are a way to package together your application along with it's dependencies, and run in a resource isolated process. They provide consistency across different hosts, efficiency over traditional hosting methods, and facilitate a micro-service based approach, where each logical piece of your application is split into multiple, easily testable parts (such as API, Backend, Frontend, etc).

For more information on containers, see the main docs.

Attributes
  • id
    string

    The ID of the container.

  • name
    string

    A human-readable name used to identify this container.

  • identifier
    string

    A human readable slugged identifier for this container. Usually used as a key in a stack file.

  • creator
    object
    includable

    A creator object. Describes who created the resource.

    Show child fields
  • environment
    object

    Information about the environment that this container is deployed to.

    Show child fields
  • hub_id
    string

    The ID of the hub that this container is associated with.

  • image
    object

    A summary of the image this container was created from.

    Show child fields
  • stack
    object
    optional

    An object describing the stack this container was built from, if any.

    Show child fields
  • config
    object

    A container configuration, the same as the config section found in the stack spec.

    Show child fields
  • instances
    integer

    The number of instances to start.

  • volumes
    array of objects
    optional

    An array of volume configuration settings as objects.

    Show child fields
  • annotations
    object | null

    A key value store of custom data for your container. Not used by the platform internally.

  • role
    string | null

    The role of this container, if any. At time of writing, can only be orchestrator.

  • stateful
    bool

    If this is set to true Cycle will treat this container as "stateful". If it is set to false, it will be treated as stateless.

  • deprecate
    bool
    optional

    Use the value Trueto denote a container as deprecated. This will cause the container to not be automatically started when all containers in an environment start and signal to other team members that this container is near EOL

  • state
    object

    Information regarding the current state of the container.

    Show child fields
  • events
    object

    A collection of timestamps for each event in the container's lifetime.

    Show child fields
  • meta
    object
    optional

    A list of meta fields that can be applied to this container. See the meta section for more details.

    Show child fields
Example Container
{
"id": "5b9c2a77b6393d0001eb45fd",
"name": "Demo Name",
"identifier": "demo-container",
"creator": {
"id": "5b9c2a77b6393d0001eb45fd",
"type": "account"
},
"environment": {
"id": "5b9c2a77b6393d0001eb45fd",
"cluster": "production",
"container_subnet": "01d6",
"ipv6": {
"ip": "fd00::452a:d6:0:0",
"cidr": "fd00::452a:d6:0:0/96"
},
"legacy": {
"subnet": 221,
"ipv4": {
"ip": "10.222.221.0",
"cidr": "10.222.221.0/16"
}
}
},
"hub_id": "5b9c2a77b6393d0001eb45fd",
"image": {
"id": "5cf4c971b894940001b730a3",
"service": null
},
"config": {
"network": {
"public": "enable",
"hostname": "test-container",
"ports": [
"9000:3000"
]
},
"deploy": {
"instances": 1,
"constraints": {
"node": {
"tags": {
"any": [],
"all": []
}
},
"secrets": [],
"containers": []
}
},
"integrations": {
"lets_encrypt": {
"enable": false
}
}
},
"instances": 1,
"annotations": {},
"stateful": false,
"role": null,
"deprecate": false,
"state": {
"changed": "2019-06-18T04:49:55.336Z",
"current": "running",
"desired": "running"
},
"events": {
"created": "2019-06-03T07:17:20.411Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z",
"started": "0001-01-01T00:00:00Z"
},
"meta": {
"domain": "containerhostname-5455ab18d1d055d02365697f.c.5b9c2a77b6393d0001eb45fd.cycle.io",
"domains": [
{
"fqdn": "containerhostname-5455ab18d1d055d02365697f.c.5b9c2a77b6393d0001eb45fd.cycle.io",
"record": null
},
{
"fqdn": "demo.domain.com",
"record": {
"id": "5fff2a77b6393d0001eb3333",
"hub_id": "5b9c2a77b6393d0001eb45fd",
"creator": {
"id": "5a232a77b6393d0001ac2df2",
"type": "account"
},
"zone_id": "5ccc2a2226393d1231eb4abd",
"name": "demo",
"resolved_domain": "demo.demo.domain.com",
"type": {
"linked": {
"container_id": "5b9c2a77b6393d0001eb45fd",
"features": {
"tls": {
"enable": false
}
}
}
},
"features": {
"certificate": {
"id": "5fff2a77b6393d0001eb3333",
"generated": "2021-01-01T18:13:52.726Z"
}
},
"state": {
"changed": "2021-01-15T18:07:06.663Z",
"current": "live"
},
"events": {
"created": "2021-01-15T18:07:06.663Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z"
}
}
},
{
"fqdn": "www.demo.demo.domain.com",
"record": null
}
],
"instance_counts": {
"state": {
"new": 0,
"starting": 0,
"reimaging": 0,
"running": 1,
"migrating": 0,
"stopping": 0,
"stopped": 0,
"failed": 0,
"deleting": 0,
"deleted": 0
},
"total": 1,
"available": 1
}
},
"includes": {
"creators": {
"accounts": {
"5abc1234b6393d3211f21dda": {
"id": "5abc1234b6393d3211f21dda",
"name": {
"first": "Demo",
"last": "User"
},
"events": {
"created": "2018-09-27T00:26:14.856Z",
"updated": "2020-06-02T06:25:30.141Z",
"deleted": "0001-01-01T00:00:00Z",
"last_login": "2021-01-21T20:07:31.225Z"
},
"email": {
"address": "demouser@cycleplatform.io",
"added": "2018-09-27T00:26:14.856Z",
"verified": true
}
}
}
},
"environments": {
"5fffb98ad1d055d02365777d": {
"id": "5fffb98ad1d055d02365777d",
"name": "discovery-test",
"about": {
"description": "",
"favorite": false
},
"creator": {
"id": "5abc1234b6393d3211f21dda",
"type": "account"
},
"hub_id": "5b9c2a77b6393d0001eb45fd",
"state": {
"changed": "2021-01-14T21:37:21.468Z",
"current": "live"
},
"cluster": "production",
"events": {
"created": "2021-01-14T21:37:14.747Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z"
},
"stack": null,
"features": {
"legacy_networking": false
},
"services": {
"discovery": {
"enable": true,
"container_id": "5fff2a77b6393d0001eb3333",
"high_availability": false,
"config": null
},
"vpn": {
"enable": false,
"container_id": "5fff2a77b6393d0001eb3333",
"high_availability": false,
"config": null
},
"loadbalancer": {
"enable": true,
"container_id": "5fff2a77b6393d0001eb3333",
"high_availability": false,
"config": null
}
},
"private_network": {
"vxlan_tag": 8221,
"subnet": "6122",
"ipv6": {
"ip": "fd00::6122:0:0:0",
"cidr": "fd00::6122:0:0:0/80"
},
"legacy": null
}
}
},
"images": {
"5241ccc9d1d055d023657846": {
"id": "5241ccc9d1d055d023657846",
"stack": null,
"size": 140108000,
"name": "demo/democontainer:latest",
"about": {
"description": null
},
"backend": {
"provider": "backblaze-b2",
"file_name": "hub-5a232a77b6393d0001ac2df2/images/5fff2a77b6393d0001eb3333.tar.gz",
"file_id": "1_5bze9a666aaa888333fff0711_f14440fea6e6cd888_d22222114_m444412_c111_v1111158_t2217",
"size": 41480967
},
"config": {
"user": "",
"ports": [],
"env": {
"NODE_VERSION": "14.2.0",
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"YARN_VERSION": "1.22.4"
},
"labels": {},
"command": [
"node",
"index.js"
],
"onbuild": [],
"entrypoint": [
"docker-entrypoint.sh"
],
"volumes": [],
"workdir": "",
"signal_stop": "SIGTERM"
},
"source": {
"docker_hub": {
"target": "demo/democontainer:latest"
}
},
"creator": {
"id": "5a232a77b6393d0001ac2df2",
"type": "account"
},
"hub_id": "5b9c2a77b6393d0001eb45fd",
"state": {
"changed": "2021-01-14T21:47:15.406Z",
"current": "live"
},
"events": {
"created": "2021-01-14T21:46:33.483Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z"
}
}
},
"stack_builds": {
"5fff3d8b49d842fddaaaa321": {
"id": "5fff3d8b49d842fddaaaa321",
"stack_id": "5aa77a0841463bbbb1c52132a",
"hub_id": "5b9c2a77b6393d0001eb45fd",
"spec": {
"about": {
"description": "test three description",
"version": ""
},
"annotations": {},
"containers": {
"redis": {
"annotations": {},
"config": {
"deploy": {
"constraints": {
"containers": [
"web"
],
"node": {
"tags": {
"all": [],
"any": []
}
},
"secrets": []
},
"health_check": null,
"instances": 1,
"restart": {
"condition": "always",
"delay": 5,
"max_attempts": 5,
"notify": {
"emails": [
"it_director@yourcompany.com",
"youremail@yourcompany.com"
],
"web_hook": null
}
},
"shutdown": {
"graceful_timeout": 30,
"signals": [
"SIGINT"
]
},
"startup": {
"delay": null
},
"stateful": null,
"strategy": "resource-density",
"telemetry": null,
"update": {
"delay": 1,
"parallelism": 1
}
},
"integrations": null,
"network": {
"hostname": "redis",
"ports": [
"6379:6379"
],
"public": "disable"
},
"resources": {
"cpu": {
"cpus": null,
"shares": {
"limit": 0,
"reserve": 1
}
},
"ram": {
"kernel": null,
"kernel_tcp": null,
"limit": null,
"reserve": "100M",
"swappiness": null
}
},
"runtime": {
"environment_vars": {
"TEST_VAR": "test_vaar_one"
},
"privileged": false,
"rlimits": {
"RLIMIT_NOFILE": {
"hard": 150000,
"soft": 100000
}
}
},
"scaling": null
},
"deprecate": false,
"image": {
"name": "redis",
"source": {
"docker_hub": {
"target": "redis:latest",
"token": "",
"username": ""
}
}
},
"name": "redis",
"role": null,
"stateful": false,
"volumes": []
},
"web": {
"annotations": {},
"config": {
"deploy": {
"constraints": null,
"health_check": null,
"instances": 1,
"restart": {
"condition": "always",
"delay": 5,
"max_attempts": 7,
"notify": {
"emails": [
"me@mycompany.com"
],
"web_hook": null
}
},
"shutdown": {
"graceful_timeout": 30,
"signals": [
"SIGINT"
]
},
"startup": {
"delay": null
},
"stateful": null,
"strategy": "resource-density",
"telemetry": null,
"update": {
"delay": 1,
"parallelism": 1
}
},
"integrations": null,
"network": {
"hostname": "web",
"ports": [
"80:80",
"443:80"
],
"public": "enable"
},
"resources": {
"cpu": {
"cpus": null,
"shares": {
"limit": 0,
"reserve": 1
}
},
"ram": {
"kernel": null,
"kernel_tcp": null,
"limit": null,
"reserve": "100M",
"swappiness": null
}
},
"runtime": {
"environment_vars": {
"TEST_VAR": "test_var"
},
"privileged": false,
"rlimits": {}
},
"scaling": null
},
"deprecate": false,
"image": {
"name": "node",
"source": {
"docker_file": {
"build_file": "/Dockerfile",
"dir": "/"
}
}
},
"name": "web",
"role": null,
"stateful": false,
"volumes": []
}
},
"services": {
"loadbalancer": null,
"vpn": null
},
"tests": null,
"version": "1.3"
},
"about": {
"version": "",
"description": "",
"git_commit": {
"hash": "aaaafb2fd37d96412fd3355e85fe3933333c0dd4",
"message": "Update cycle.json",
"time": "2020-07-08T04:02:53Z",
"author": {
"name": "GitHub",
"email": "noreply@github.com"
}
}
},
"instructions": {},
"events": {
"created": "2021-01-19T23:38:51.082Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z"
},
"state": {
"changed": "2021-01-19T23:40:12.827Z",
"current": "live"
}
}
},
"stacks": {
"5aa77a0841463bbbb1c52132a": {
"id": "5aa77a0841463bbbb1c52132a",
"name": "Website + Redis",
"creator": {
"id": "5a232a77b6393d0001ac2df2",
"type": "account"
},
"hub_id": "5b9c2a77b6393d0001eb45fd",
"source": {
"repo": {
"url": "https://github.com/demo/demostack.git"
}
},
"state": {
"changed": "2019-04-29T23:34:32.2Z",
"current": "live"
},
"events": {
"created": "2019-04-29T23:34:32.2Z",
"updated": "2020-04-20T19:38:01.677Z",
"deleted": "0001-01-01T00:00:00Z",
"last_build": "2021-01-19T23:40:11.532Z"
}
}
}
}
}