summaryrefslogtreecommitdiff
path: root/cmd/podman/main_local.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-04-22 16:01:31 -0500
committerbaude <bbaude@redhat.com>2019-04-30 15:28:39 -0500
commit0b6bb6a3d3c3c15b9c6629a6949a616a30b0478a (patch)
treeee8d23d62036f815a759c3aac41f1ac616c4188f /cmd/podman/main_local.go
parentb5af10ce5a51f8ac2c7f7b101006412287d17b68 (diff)
downloadpodman-0b6bb6a3d3c3c15b9c6629a6949a616a30b0478a.tar.gz
podman-0b6bb6a3d3c3c15b9c6629a6949a616a30b0478a.tar.bz2
podman-0b6bb6a3d3c3c15b9c6629a6949a616a30b0478a.zip
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>
Diffstat (limited to 'cmd/podman/main_local.go')
-rw-r--r--cmd/podman/main_local.go27
1 files changed, 24 insertions, 3 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index 5afd51e28..7452965a2 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -4,16 +4,17 @@ package main
import (
"context"
- "github.com/containers/libpod/cmd/podman/cliconfig"
- "github.com/containers/libpod/cmd/podman/libpodruntime"
- "github.com/containers/libpod/pkg/rootless"
"io/ioutil"
"log/syslog"
"os"
"runtime/pprof"
"strconv"
"strings"
+ "syscall"
+ "github.com/containers/libpod/cmd/podman/cliconfig"
+ "github.com/containers/libpod/cmd/podman/libpodruntime"
+ "github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/tracing"
"github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
@@ -154,3 +155,23 @@ func setupRootless(cmd *cobra.Command, args []string) error {
}
return nil
}
+func setRLimits() error {
+ rlimits := new(syscall.Rlimit)
+ rlimits.Cur = 1048576
+ rlimits.Max = 1048576
+ if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
+ if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
+ return errors.Wrapf(err, "error getting rlimits")
+ }
+ rlimits.Cur = rlimits.Max
+ if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil {
+ return errors.Wrapf(err, "error setting new rlimits")
+ }
+ }
+ return nil
+}
+
+func setUMask() {
+ // Be sure we can create directories with 0755 mode.
+ syscall.Umask(0022)
+}