mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
add a podman-compose command
**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>
This commit is contained in:
18
vendor/github.com/containers/common/pkg/util/util.go
generated
vendored
18
vendor/github.com/containers/common/pkg/util/util.go
generated
vendored
@@ -27,7 +27,16 @@ func queryPackageVersion(cmdArg ...string) string {
|
||||
cmd := exec.Command(cmdArg[0], cmdArg[1:]...)
|
||||
if outp, err := cmd.Output(); err == nil {
|
||||
output = string(outp)
|
||||
if cmdArg[0] == "/usr/bin/dpkg" {
|
||||
deb := false
|
||||
if cmdArg[0] == "/usr/bin/dlocate" {
|
||||
// can return multiple matches
|
||||
l := strings.Split(output, "\n")
|
||||
output = l[0]
|
||||
deb = true
|
||||
} else if cmdArg[0] == "/usr/bin/dpkg" {
|
||||
deb = true
|
||||
}
|
||||
if deb {
|
||||
r := strings.Split(output, ": ")
|
||||
queryFormat := `${Package}_${Version}_${Architecture}`
|
||||
cmd = exec.Command("/usr/bin/dpkg-query", "-f", queryFormat, "-W", r[0])
|
||||
@@ -47,9 +56,14 @@ func queryPackageVersion(cmdArg ...string) string {
|
||||
// Note: This function is copied from containers/podman libpod/util.go
|
||||
// Please see https://github.com/containers/common/pull/1460
|
||||
func PackageVersion(program string) string { // program is full path
|
||||
_, err := os.Stat(program)
|
||||
if err != nil {
|
||||
return UnknownPackage
|
||||
}
|
||||
packagers := [][]string{
|
||||
{"/usr/bin/rpm", "-q", "-f"},
|
||||
{"/usr/bin/dpkg", "-S"}, // Debian, Ubuntu
|
||||
{"/usr/bin/dlocate", "-F"}, // Debian, Ubuntu (quick)
|
||||
{"/usr/bin/dpkg", "-S"}, // Debian, Ubuntu (slow)
|
||||
{"/usr/bin/pacman", "-Qo"}, // Arch
|
||||
{"/usr/bin/qfile", "-qv"}, // Gentoo (quick)
|
||||
{"/usr/bin/equery", "b"}, // Gentoo (slow)
|
||||
|
||||
Reference in New Issue
Block a user