mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
enable podman-remote on windows
build a podman-remote binary for windows that allows users to use the remote client on windows and interact with podman on linux system. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/buildah/buildah.go
generated
vendored
2
vendor/github.com/containers/buildah/buildah.go
generated
vendored
@@ -26,7 +26,7 @@ const (
|
||||
Package = "buildah"
|
||||
// Version for the Package. Bump version in contrib/rpm/buildah.spec
|
||||
// too.
|
||||
Version = "1.8.0"
|
||||
Version = "1.9.0-dev"
|
||||
// The value we use to identify what type of information, currently a
|
||||
// serialized Builder structure, we are using as per-container state.
|
||||
// This should only be changed when we make incompatible changes to
|
||||
|
||||
@@ -24,6 +24,22 @@ func init() {
|
||||
reexec.Register(symlinkModifiedTime, resolveSymlinkTimeModified)
|
||||
}
|
||||
|
||||
// resolveSymlink uses a child subprocess to resolve any symlinks in filename
|
||||
// in the context of rootdir.
|
||||
func resolveSymlink(rootdir, filename string) (string, error) {
|
||||
// The child process expects a chroot and one path that
|
||||
// will be consulted relative to the chroot directory and evaluated
|
||||
// for any symbolic links present.
|
||||
cmd := reexec.Command(symlinkChrootedCommand, rootdir, filename)
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, string(output))
|
||||
}
|
||||
|
||||
// Hand back the resolved symlink, will be filename if a symlink is not found
|
||||
return string(output), nil
|
||||
}
|
||||
|
||||
// main() for resolveSymlink()'s subprocess.
|
||||
func resolveChrootedSymlinks() {
|
||||
status := 0
|
||||
@@ -55,22 +71,6 @@ func resolveChrootedSymlinks() {
|
||||
os.Exit(status)
|
||||
}
|
||||
|
||||
// resolveSymlink uses a child subprocess to resolve any symlinks in filename
|
||||
// in the context of rootdir.
|
||||
func resolveSymlink(rootdir, filename string) (string, error) {
|
||||
// The child process expects a chroot and one path that
|
||||
// will be consulted relative to the chroot directory and evaluated
|
||||
// for any symbolic links present.
|
||||
cmd := reexec.Command(symlinkChrootedCommand, rootdir, filename)
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, string(output))
|
||||
}
|
||||
|
||||
// Hand back the resolved symlink, will be filename if a symlink is not found
|
||||
return string(output), nil
|
||||
}
|
||||
|
||||
// main() for grandparent subprocess. Its main job is to shuttle stdio back
|
||||
// and forth, managing a pseudo-terminal if we want one, for our child, the
|
||||
// parent subprocess.
|
||||
13
vendor/github.com/containers/buildah/imagebuildah/chroot_symlink_unsupported.go
generated
vendored
Normal file
13
vendor/github.com/containers/buildah/imagebuildah/chroot_symlink_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// +build !linux
|
||||
|
||||
package imagebuildah
|
||||
|
||||
import "github.com/pkg/errors"
|
||||
|
||||
func resolveSymlink(rootdir, filename string) (string, error) {
|
||||
return "", errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
|
||||
func resolveModifiedTime(rootdir, filename, historyTime string) (bool, error) {
|
||||
return false, errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
12
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
12
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@@ -22,7 +22,6 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -39,14 +38,9 @@ func CommonBuildOptions(c *cobra.Command) (*buildah.CommonBuildOptions, error) {
|
||||
memorySwap int64
|
||||
err error
|
||||
)
|
||||
rlim := unix.Rlimit{Cur: 1048576, Max: 1048576}
|
||||
defaultLimits := []string{}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nofile=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NPROC, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nproc=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
|
||||
defaultLimits := getDefaultProcessLimits()
|
||||
|
||||
memVal, _ := c.Flags().GetString("memory")
|
||||
if memVal != "" {
|
||||
memoryLimit, err = units.RAMInBytes(memVal)
|
||||
|
||||
20
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
Normal file
20
vendor/github.com/containers/buildah/pkg/parse/parse_unix.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build linux darwin
|
||||
|
||||
package parse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func getDefaultProcessLimits() []string {
|
||||
rlim := unix.Rlimit{Cur: 1048576, Max: 1048576}
|
||||
defaultLimits := []string{}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NOFILE, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nofile=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
if err := unix.Setrlimit(unix.RLIMIT_NPROC, &rlim); err == nil {
|
||||
defaultLimits = append(defaultLimits, fmt.Sprintf("nproc=%d:%d", rlim.Cur, rlim.Max))
|
||||
}
|
||||
return defaultLimits
|
||||
}
|
||||
7
vendor/github.com/containers/buildah/pkg/parse/parse_unsupported.go
generated
vendored
Normal file
7
vendor/github.com/containers/buildah/pkg/parse/parse_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// +build !linux,!darwin
|
||||
|
||||
package parse
|
||||
|
||||
func getDefaultProcessLimits() []string {
|
||||
return []string{}
|
||||
}
|
||||
2020
vendor/github.com/containers/buildah/run.go
generated
vendored
2020
vendor/github.com/containers/buildah/run.go
generated
vendored
File diff suppressed because it is too large
Load Diff
2022
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
2022
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
File diff suppressed because it is too large
Load Diff
11
vendor/github.com/containers/buildah/run_unsupport.go
generated
vendored
11
vendor/github.com/containers/buildah/run_unsupport.go
generated
vendored
@@ -1,11 +0,0 @@
|
||||
// +build !linux
|
||||
|
||||
package buildah
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func setChildProcess() error {
|
||||
return errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
20
vendor/github.com/containers/buildah/run_unsupported.go
generated
vendored
Normal file
20
vendor/github.com/containers/buildah/run_unsupported.go
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build !linux
|
||||
|
||||
package buildah
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func setChildProcess() error {
|
||||
return errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
|
||||
func runUsingRuntimeMain() {}
|
||||
|
||||
func (b *Builder) Run(command []string, options RunOptions) error {
|
||||
return errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
func DefaultNamespaceOptions() (NamespaceOptions, error) {
|
||||
return NamespaceOptions{}, errors.New("function not supported on non-linux systems")
|
||||
}
|
||||
Reference in New Issue
Block a user