AddVolume
Method
func (Service) AddVolume( source string, target string, options ...*ServiceAddVolumeOptions,) ServiceSignature
method
AddVolume Adds a volume mount to a generated Docker Compose service.
AddVolume( source string, target string, options ...*ServiceAddVolumeOptions,) ServiceParameters
sourcestringThe source volume name or host path.targetstringThe target path inside the container.options...*ServiceAddVolumeOptions Optional settings, described under Options.Options
Optional parameters are passed in a trailing options ...*ServiceAddVolumeOptions argument.
Type*stringThe Docker Compose volume type, such as volume or bind.IsReadOnly *boolA value indicating whether the volume is mounted as read-only.Configurefunc(obj Volume) callbackAn optional callback for further volume customization.Returns
ServiceThe updated Docker Compose service.
Returns a handle; failures surface later via Err().
Applies to
This method applies to the following types: