@@ -293,9 +293,18 @@ func (rc *RunContext) startJobContainer() common.Executor {
293293 if err != nil {
294294 return fmt .Errorf ("failed to handle service %s credentials: %w" , serviceID , err )
295295 }
296- serviceBinds , serviceMounts := rc .GetServiceBindsAndMounts (spec .Volumes )
297296
298- exposedPorts , portBindings , err := nat .ParsePortSpecs (spec .Ports )
297+ interpolatedVolumes := make ([]string , 0 , len (spec .Volumes ))
298+ for _ , volume := range spec .Volumes {
299+ interpolatedVolumes = append (interpolatedVolumes , rc .ExprEval .Interpolate (ctx , volume ))
300+ }
301+ serviceBinds , serviceMounts := rc .GetServiceBindsAndMounts (interpolatedVolumes )
302+
303+ interpolatedPorts := make ([]string , 0 , len (spec .Ports ))
304+ for _ , port := range spec .Ports {
305+ interpolatedPorts = append (interpolatedPorts , rc .ExprEval .Interpolate (ctx , port ))
306+ }
307+ exposedPorts , portBindings , err := nat .ParsePortSpecs (interpolatedPorts )
299308 if err != nil {
300309 return fmt .Errorf ("failed to parse service %s ports: %w" , serviceID , err )
301310 }
@@ -304,7 +313,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
304313 c := container .NewContainer (& container.NewContainerInput {
305314 Name : serviceContainerName ,
306315 WorkingDir : ext .ToContainerPath (rc .Config .Workdir ),
307- Image : spec .Image ,
316+ Image : rc . ExprEval . Interpolate ( ctx , spec .Image ) ,
308317 Username : username ,
309318 Password : password ,
310319 Env : envs ,
@@ -315,7 +324,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
315324 Privileged : rc .Config .Privileged ,
316325 UsernsMode : rc .Config .UsernsMode ,
317326 Platform : rc .Config .ContainerArchitecture ,
318- Options : spec .Options ,
327+ Options : rc . ExprEval . Interpolate ( ctx , spec .Options ) ,
319328 NetworkMode : networkName ,
320329 NetworkAliases : []string {serviceID },
321330 ExposedPorts : exposedPorts ,
0 commit comments