Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ RUN apt-get --no-install-recommends install -y uidmap sudo vim iptables fuse \
&& mkdir -m 0700 -p /run/user/1000 \
&& chown -R user /run/user/1000 /home/user \
&& update-alternatives --set iptables /usr/sbin/iptables-legacy
# The entrypoint script is needed for enabling nested cgroup v2 (https://github.com/moby/buildkit/issues/3265#issuecomment-1309631736)
RUN curl -Ls https://raw.githubusercontent.com/moby/moby/v20.10.21/hack/dind > /docker-entrypoint.sh \
&& chmod 0755 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# musl is needed to directly use the registry binary that is built on alpine
ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.3=/opt/containerd-alt/bin"
ENV BUILDKIT_INTEGRATION_SNAPSHOTTER=stargz
Expand Down
10 changes: 8 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
if secMode == securitySandbox {
allowedEntitlements = []entitlements.Entitlement{}
} else {
t.Skip("Failing on 0.8 branch; see https://github.com/moby/buildkit/pull/3439")
skipDockerd(t, sb)
mode = llb.SecurityModeInsecure
allowedEntitlements = []entitlements.Entitlement{entitlements.EntitlementSecurityInsecure}
Expand All @@ -660,7 +661,12 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
require.NoError(t, err)
defer c.Close()

command := `mkdir /sys/fs/cgroup/cpuset/securitytest`
cg := "/sys/fs/cgroup/cpuset/securitytest" // cgroup v1
if _, err := os.Stat("/sys/fs/cgroup/cpuset"); errors.Is(err, os.ErrNotExist) {
cg = "/sys/fs/cgroup/securitytest" // cgroup v2
}

command := "mkdir " + cg
st := llb.Image("busybox:latest").
Run(llb.Shlex(command),
llb.Security(mode))
Expand All @@ -675,7 +681,7 @@ func testSecurityModeSysfs(t *testing.T, sb integration.Sandbox) {
if secMode == securitySandbox {
require.Error(t, err)
require.Contains(t, err.Error(), "executor failed running")
require.Contains(t, err.Error(), "mkdir /sys/fs/cgroup/cpuset/securitytest")
require.Contains(t, err.Error(), "mkdir "+cg)
} else {
require.NoError(t, err)
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/dockerfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ COPY --from=busybox /etc/passwd test

dockerfile = []byte(`
FROM busybox AS golang
RUN mkdir /usr/bin && echo -n foo > /usr/bin/go
RUN mkdir -p /usr/bin && echo -n foo > /usr/bin/go

FROM scratch
COPY --from=golang /usr/bin/go go
Expand Down
2 changes: 1 addition & 1 deletion hack/test
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fi
if [ "$TEST_GATEWAY" == 1 ]; then
# Build-test "github.com/moby/buildkit/frontend/gateway/client", which isn't otherwise built by CI
# It really only needs buildkit-base. We have integration-tests in $iid, which is a direct child of buildkit-base.
cid=$(docker create --rm --volumes-from=$cacheVolume $iid go build -v ./frontend/gateway/client)
cid=$(docker create --rm --volumes-from=$cacheVolume --entrypoint="" $iid go build -v ./frontend/gateway/client)
docker start -a $cid
fi

Expand Down