forked from genuinetools/img
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow running without securityContext.procMount=Unmasked (BuildKit v…
…0.4) (genuinetools#221) * vendor BuildKit v0.4.0 Signed-off-by: Akihiro Suda <[email protected]> * Dockerfile: remove extra runc binary Signed-off-by: Akihiro Suda <[email protected]> * allow running without securityContext.procMount=Unmasked When `/proc` is not mountable, img now automatically disables process sandbox (PID namespace isolation). Note that this allows build containers to `kill(2)` (and potentially `ptrace(2)` when seccomp is unavailable) the `img` process. To run `img` in a Docker container, you no longer need to specify `--privileged`, but you still need to specify `--security-opt seccomp=unconfined --security-opt apparmor=unconfined` (which are unconfined on Kubernetes by default). Signed-off-by: Akihiro Suda <[email protected]> * e2e: suppress log output So as to avoid Travis quota Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
2e8ff3a
commit 3d1a167
Showing
706 changed files
with
82,348 additions
and
7,264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
ARG RUNC_VERSION=9f9c96235cc97674e935002fc3d78361b696a69e | ||
FROM golang:1.10-alpine AS gobuild-base | ||
FROM golang:1.11-alpine AS gobuild-base | ||
RUN apk add --no-cache \ | ||
bash \ | ||
build-base \ | ||
|
@@ -9,13 +8,6 @@ RUN apk add --no-cache \ | |
linux-headers \ | ||
make | ||
|
||
FROM gobuild-base AS runc | ||
ARG RUNC_VERSION | ||
RUN git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ | ||
&& cd "$GOPATH/src/github.com/opencontainers/runc" \ | ||
&& make static BUILDTAGS="seccomp" EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS="-extldflags \\\"-fno-PIC -static\\\"" \ | ||
&& mv runc /usr/bin/runc | ||
|
||
FROM gobuild-base AS img | ||
WORKDIR /go/src/github.com/genuinetools/img | ||
COPY . . | ||
|
@@ -43,18 +35,19 @@ FROM alpine:3.8 AS base | |
MAINTAINER Jessica Frazelle <[email protected]> | ||
RUN apk add --no-cache git | ||
COPY --from=img /usr/bin/img /usr/bin/img | ||
COPY --from=runc /usr/bin/runc /usr/bin/runc | ||
COPY --from=idmap /usr/bin/newuidmap /usr/bin/newuidmap | ||
COPY --from=idmap /usr/bin/newgidmap /usr/bin/newgidmap | ||
RUN chmod u+s /usr/bin/newuidmap /usr/bin/newgidmap \ | ||
&& adduser -D -u 1000 user \ | ||
&& mkdir -p /run/user/1000 \ | ||
&& chown -R user /run/user/1000 /home/user \ | ||
&& echo user:100000:65536 | tee /etc/subuid | tee /etc/subgid | ||
# As of v3.8.1, Alpine does not set SUID bit on the busybox version of /bin/su. | ||
# However, future version may set SUID bit on /bin/su. | ||
# We lock the root account so as to disable su completely. | ||
RUN passwd -l root | ||
# In previous version of `alpine:3.8`, the root was not locked and su-able | ||
# without any password when SUID bit is set on `/bin/su`. | ||
# | ||
# As of 3/15/2019, the root is locked by default, but we expliciltly lock the | ||
# root just in case. | ||
RUN passwd -l root || true | ||
|
||
FROM base AS debug | ||
RUN apk add --no-cache bash strace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.