mirror of
https://github.com/containers/podman.git
synced 2025-05-20 16:47:39 +08:00

**podman compose** is a thin wrapper around an external compose provider such as docker-compose or podman-compose. This means that `podman compose` is executing another tool that implements the compose functionality but sets up the environment in a way to let the compose provider communicate transparently with the local Podman socket. The specified options as well the command and argument are passed directly to the compose provider. The default compose providers are `docker-compose` and `podman-compose`. If installed, `docker-compose` takes precedence since it is the original implementation of the Compose specification and is widely used on the supported platforms (i.e., Linux, Mac OS, Windows). If you want to change the default behavior or have a custom installation path for your provider of choice, please change the `compose_provider` field in `containers.conf(5)`. You may also set the `PODMAN_COMPOSE_PROVIDER` environment variable. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
57 lines
1.4 KiB
Go
57 lines
1.4 KiB
Go
package config
|
|
|
|
import "os"
|
|
|
|
// getDefaultImage returns the default machine image stream
|
|
// On Windows this refers to the Fedora major release number
|
|
func getDefaultMachineImage() string {
|
|
return "35"
|
|
}
|
|
|
|
// getDefaultMachineUser returns the user to use for rootless podman
|
|
func getDefaultMachineUser() string {
|
|
return "user"
|
|
}
|
|
|
|
// isCgroup2UnifiedMode returns whether we are running in cgroup2 mode.
|
|
func isCgroup2UnifiedMode() (isUnified bool, isUnifiedErr error) {
|
|
return false, nil
|
|
}
|
|
|
|
// getDefaultProcessLimits returns the nofile and nproc for the current process in ulimits format
|
|
func getDefaultProcessLimits() []string {
|
|
return []string{}
|
|
}
|
|
|
|
// getDefaultTmpDir for windows
|
|
func getDefaultTmpDir() string {
|
|
// first check the Temp env var
|
|
// https://answers.microsoft.com/en-us/windows/forum/all/where-is-the-temporary-folder/44a039a5-45ba-48dd-84db-fd700e54fd56
|
|
if val, ok := os.LookupEnv("TEMP"); ok {
|
|
return val
|
|
}
|
|
return os.Getenv("LOCALAPPDATA") + "\\Temp"
|
|
}
|
|
|
|
func getDefaultCgroupsMode() string {
|
|
return "enabled"
|
|
}
|
|
|
|
func getDefaultLockType() string {
|
|
return "shm"
|
|
}
|
|
|
|
func getLibpodTmpDir() string {
|
|
return "/run/libpod"
|
|
}
|
|
|
|
// getDefaultMachineVolumes returns default mounted volumes (possibly with env vars, which will be expanded)
|
|
func getDefaultMachineVolumes() []string {
|
|
return []string{}
|
|
}
|
|
|
|
func getDefaultComposeProviders() []string {
|
|
// Rely on os.LookPath to do the trick on Windows.
|
|
return []string{"docker-compose", "podman-compose"}
|
|
}
|