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

Function osDependentRunDir

internal/locker/runtime_unix.go:31–43  ·  view source on GitHub ↗

Based on https://github.com/adrg/xdg Licensed under MIT License (MIT) Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>

()

Source from the content-addressed store, hash-verified

29// Copyright (c) 2014 Adrian-George Bostan <adrg@epistack.com>
30
31func osDependentRunDir() (string, error) {
32 run := filepath.Join("run", "user", strconv.Itoa(os.Getuid()))
33 if _, err := os.Stat(run); err == nil {
34 return run, nil
35 }
36
37 // /run/user/$uid is set by pam_systemd, but might not be present, especially in containerized environments
38 home, err := os.UserHomeDir()
39 if err != nil {
40 return "", err
41 }
42 return filepath.Join(home, ".docker", "docker-compose"), nil
43}

Callers 1

runDirFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected