mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
add -v|--volume to bind mount host path into a service container
This commit is contained in:
@@ -42,6 +42,8 @@ type ContainerSpec struct {
|
||||
Image string
|
||||
// Run a custom init inside the container. If nil, use the daemon's configured settings.
|
||||
Init *bool
|
||||
// List of volumes to bind mount into the container.
|
||||
Volumes []string
|
||||
}
|
||||
|
||||
func (s *ContainerSpec) Validate() error {
|
||||
|
||||
@@ -268,6 +268,7 @@ func (cli *Client) runContainer(
|
||||
}
|
||||
}
|
||||
hostConfig := &container.HostConfig{
|
||||
Binds: spec.Container.Volumes,
|
||||
Init: spec.Container.Init,
|
||||
PortBindings: portBindings,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user