-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for rootless containers #204
base: master
Are you sure you want to change the base?
Changes from all commits
eca7704
6797b9e
537ce95
a2e37c3
4ec728f
a539f0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
AUTHORS | ||
contrib | ||
COPYING | ||
doc | ||
Dockerfile | ||
install-proot.sh | ||
ISSUE_TEMPLATE | ||
*.rst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM debian:9 AS build | ||
RUN apt-get update && apt-get install -q -y build-essential git libseccomp-dev libtalloc-dev \ | ||
# deps for PERSISTENT_CHOWN extension | ||
libprotobuf-c-dev libattr1-dev | ||
ADD . PRoot/ | ||
RUN cd PRoot \ | ||
&& cd src \ | ||
&& make && mv proot / && make clean | ||
|
||
FROM scratch as proot | ||
COPY --from=build /proot /runrootless-proot | ||
|
||
# | ||
# can install the binary using: | ||
# | ||
# docker build --target proot --output ~/.runrootless . | ||
# | ||
# |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Buildroot : %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) | |
Prefix : /usr | ||
Name : proot | ||
|
||
BuildRequires: libtalloc-devel | ||
BuildRequires: libtalloc-devel, protobuf-c-devel, libattr-devel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be declared as optional dependencies. Not sure off the top of my head how to do that with RPM. |
||
|
||
%if 0%{?suse_version} >= 1210 || 0%{?fedora_version} >= 15 | ||
BuildRequires: glibc-static | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# If you want to build outside of the source tree, use the -f option: | ||
# make -f ${SOMEWHERE}/proot/src/GNUmakefile | ||
|
||
PERSISTENT_CHOWN := 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be disabled by default. |
||
|
||
# the VPATH variable must point to the actual makefile directory | ||
VPATH := $(dir $(lastword $(MAKEFILE_LIST))) | ||
SRC = $(dir $(firstword $(MAKEFILE_LIST))) | ||
|
@@ -18,10 +20,17 @@ HAS_SWIG := $(shell swig -version 2>/dev/null) | |
HAS_PYTHON_CONFIG := $(shell python2.7-config --ldflags 2>/dev/null) | ||
|
||
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH) | ||
ifdef PERSISTENT_CHOWN | ||
CPPFLAGS += -DPERSISTENT_CHOWN | ||
CPPFLAGS += $(shell pkg-config --cflags libprotobuf-c) | ||
endif | ||
CFLAGS += -Wall -Wextra -O2 | ||
LDFLAGS += -ltalloc -Wl,-z,noexecstack | ||
LDFLAGS += -L. -ltalloc -Wl,-z,noexecstack -static | ||
ifdef PERSISTENT_CHOWN | ||
LDFLAGS += $(shell pkg-config --libs libprotobuf-c) | ||
endif | ||
|
||
CARE_LDFLAGS = -larchive | ||
CARE_LDFLAGS = -larchive -static | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be |
||
|
||
OBJECTS += \ | ||
cli/cli.o \ | ||
|
@@ -64,6 +73,10 @@ OBJECTS += \ | |
extension/portmap/map.o \ | ||
loader/loader-wrapped.o | ||
|
||
ifdef PERSISTENT_CHOWN | ||
OBJECTS += rootlesscontainers/rootlesscontainers.pb-c.o | ||
endif | ||
|
||
define define_from_arch.h | ||
$2$1 := $(shell $(CC) $1 -E -dM -DNO_LIBC_HEADER $(SRC)/arch.h | grep -w $2 | cut -f 3 -d ' ') | ||
endef | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See Dockerfile structure, https://github.com/proot-me/proot/tree/test-docker