Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Barrel Meta

雾雨 edited this page Apr 29, 2021 · 1 revision

You can add more meta data on your container so that barrel may do some automatic operation for you

Definition:

type BarrelLabel struct {
	FixedIP bool
	Mount   []string
}

FixedIP could be used to indicate the container require fixed ip(the fixed-ip label will also be supported for compatibility) Mount is used for clean up when container is removed(clean up when container prune is not supported yet)

Key for the label is BARREL and the value should be encoding in JSON. A sample when create container via cli:

docker -H unix:///var/run/barrel.sock container create --label BARREL="{\"FixedIP\": true, \"Mount\": [\"/data/rds/cluster01/container01\"]}" --network calico-01 nginx:latest
Clone this wiki locally