MCPcopy
hub / github.com/docker/compose / runConfig

Function runConfig

cmd/compose/config.go:176–203  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string)

Source from the content-addressed store, hash-verified

174}
175
176func runConfig(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) (err error) {
177 var content []byte
178 if opts.noInterpolate {
179 content, err = runConfigNoInterpolate(ctx, dockerCli, opts, services)
180 if err != nil {
181 return err
182 }
183 } else {
184 content, err = runConfigInterpolate(ctx, dockerCli, opts, services)
185 if err != nil {
186 return err
187 }
188 }
189
190 if !opts.noInterpolate {
191 content = escapeDollarSign(content)
192 }
193
194 if opts.quiet {
195 return nil
196 }
197
198 if opts.Output != "" && len(content) > 0 {
199 return os.WriteFile(opts.Output, content, 0o666)
200 }
201 _, err = fmt.Fprint(dockerCli.Out(), string(content))
202 return err
203}
204
205func runConfigInterpolate(ctx context.Context, dockerCli command.Cli, opts configOptions, services []string) ([]byte, error) {
206 backend, err := compose.NewComposeService(dockerCli)

Callers 1

configCommandFunction · 0.85

Calls 5

runConfigNoInterpolateFunction · 0.85
runConfigInterpolateFunction · 0.85
escapeDollarSignFunction · 0.85
WriteFileMethod · 0.80
OutMethod · 0.45

Tested by

no test coverage detected