MCPcopy Index your code
hub / github.com/docker/cli / newCIDFile

Function newCIDFile

cli/command/container/create.go:197–211  ·  view source on GitHub ↗
(cidPath string)

Source from the content-addressed store, hash-verified

195}
196
197func newCIDFile(cidPath string) (*cidFile, error) {
198 if cidPath == "" {
199 return &cidFile{}, nil
200 }
201 if _, err := os.Stat(cidPath); err == nil {
202 return nil, errors.New("container ID file found, make sure the other container isn't running or delete " + cidPath)
203 }
204
205 f, err := os.Create(cidPath)
206 if err != nil {
207 return nil, fmt.Errorf("failed to create the container ID file: %w", err)
208 }
209
210 return &cidFile{path: cidPath, file: f}, nil
211}
212
213//nolint:gocyclo
214func createContainer(ctx context.Context, dockerCLI command.Cli, containerCfg *containerConfig, options *createOptions) (containerID string, _ error) {

Callers 5

createContainerFunction · 0.85

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…