Docker compose conversion support
Behind the scenes, we use kompose.io to perform the initial translation from docker-compose.yml to the Kubernetes manifest.
The table below states the support for each possible Docker Compose key.
build
yes
Builds/Pushes to Docker repository.
build: context
yes
build: dockerfile
yes
build: args
yes
build: cache_from
no
cap_add, cap_drop
yes
Pod.Spec.Container.SecurityContext.Capabilities.Add/Drop
command
yes
Pod.Spec.Container.Args
configs
yes
configs: short-syntax
yes
Only create configMap
configs: long-syntax
yes
If target path is /, ignore this and only create configMap
cgroup_parent
n/a
Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/11986
container_name
yes
Metadata.Name + Deployment.Spec.Containers.Name
credential_spec
no
Only applicable to Windows containers
deploy
yes
deploy: mode
yes
deploy: replicas
yes
Deployment.Spec.Replicas / DeploymentConfig.Spec.Replicas
deploy: placement
yes
Pod.Spec.Affinity
deploy: update_config
yes
Workload.Spec.Strategy
Deployment / DeploymentConfig
deploy: resources
yes
Containers.Resources.Limits.Memory / Containers.Resources.Limits.CPU
Support for memory as well as cpu
deploy: labels
yes
Workload.Metadata.Labels
Only applied to workload resource
devices
n/a
Not supported within Kubernetes, See issue https://github.com/kubernetes/kubernetes/issues/5607
depends_on
n/a
dns
n/a
Not used within Kubernetes. Kubernetes uses a managed DNS server
dns_search
n/a
See dns key
domainname
yes
Pod.Spec.SubDomain
tmpfs
yes
Pod.Spec.Containers.Volumes.EmptyDir
Creates emptyDirvolume with medium set to Memory & mounts given directory inside container
entrypoint
yes
Pod.Spec.Container.Command
env_file
yes
environment
yes
Pod.Spec.Container.Env
expose
yes
Service.Spec.Ports
endpoint_mode
yes
If endpoint_mode=vip, the created Service will be forced to set to NodePort type
extends
yes
Extends by utilizing the same image supplied
external_links
n/a
Kubernetes uses a flat-structure for all containers and thus external_links does not have a 1-1 conversion
extra_hosts
no
group_add
yes
healthcheck
no
hostname
yes
Pod.Spec.HostName
image
yes
Deployment.Spec.Containers.Image
isolation
n/a
Not applicable as this applies to Windows with HyperV support
labels
yes
Metadata.Annotations
links
n/a
All containers in the same pod are accessible in Kubernetes
logging
n/a
Kubernetes has built-in logging support at the node-level
network_mode
n/a
Kubernetes uses its own cluster networking
networks
on
See networks key
networks: aliases
n/a
See networks key
networks: addresses
n/a
See networks key
pid
yes
Pod.Spec.HostPID
ports
yes
Service.Spec.Ports
ports: short-syntax
yes
Service.Spec.Ports
ports: long-syntax
yes
Service.Spec.Ports
secrets
yes
Secret
External Secret is not Supported
secrets: short-syntax
yes
Secret
External Secret is not Supported
secrets: long-syntax
yes
Secret
External Secret is not Supported
security_opt
n/a
Kubernetes uses its own container naming scheme
stop_grace_period
yes
Pod.Spec.TerminationGracePeriodSeconds
stop_signal
n/a
Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/30051
sysctls
no
ulimits
n/a
Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/3595
userns_mode
n/a
Not supported within Kubernetes and ignored in Docker Compose Version 3
volumes
yes
PersistentVolumeClaim
Creates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
volumes: short-syntax
yes
PersistentVolumeClaim
Creates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
volumes: long-syntax
yes
PersistentVolumeClaim
Creates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
restart
no
Volume
n/a
driver
n/a
driver_opts
n/a
external
n/a
labels
n/a
Network
n/a
driver
n/a
driver_opts
n/a
enable_ipv6
n/a
ipam
n/a
internal
n/a
labels
n/a
external
n/a
Last updated
Was this helpful?
