Service.AddVolume
Method
type Service interface { // ... omitted for brevity AddVolume( source string, target string, options ...*ServiceAddVolumeOptions, ) Service}Signature
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().
Defined on
This method is defined on the following type: