Unverified Commit e21581e1 authored by boklm's avatar boklm
Browse files

Bug 23425: fix build when there is no terminal

Set process.terminal to false when building, but keep it to true when we
open a debugging shell.

https://github.com/opencontainers/runtime-spec/blob/master/config.md#process

To do that we update the runc config.json in runc/remote_exec rather
than only once in runc/remote_start.

We also redirect runc stderr to /dev/null to avoid some messages saying
"stdin: is not a tty" during the build.
parent b2dd9816
......@@ -9,7 +9,7 @@
[% END -%]
},
"process": {
"terminal": true,
"terminal": [% IF c("interactive") %]true[% ELSE %]false[% END %],
"user": {
"uid": 0,
"gid": 0
......
......@@ -308,9 +308,6 @@ runc:
fi
mkdir -p '[% c("var/container/dir") %]'/rootfs/rbm
sudo tar -C '[% c("var/container/dir") %]'/rootfs -xf $(ls -1 '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'*)
cat > '[% c("var/container/dir") %]'/config.json << EOF
[% INCLUDE 'runc-config.json' %]
EOF
[% SET user = c("var/container/user") -%]
[% c("remote_exec", { exec_as_root => 1, exec_cmd => 'id ' _ user
_ ' >/dev/null 2>&1 || adduser -m ' _ user _ ' || useradd -m ' _ user }) %]
......@@ -329,7 +326,10 @@ runc:
echo 'su - [% user %] -c /rbm/cmd' >> '[% c("var/container/dir") %]'/rootfs/rbm/run
chmod +x '[% c("var/container/dir") %]'/rootfs/rbm/cmd
chmod +x '[% c("var/container/dir") %]'/rootfs/rbm/run
sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %]
cat > '[% c("var/container/dir") %]'/config.json << EOF
[% INCLUDE 'runc-config.json' %]
EOF
sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %] [% IF ! c("interactive") %]2>/dev/null[% END %]
remote_put: |
#!/bin/sh
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment