我试图在Rkt容器中制作一个简单的Ruby应用程序,但我的构建脚本一直给我变化:
Warning: "/bin/sh" is a symlink, which systemd-nspawn version 219 might error on
Directory /too/long/for/so/.acbuild/target lacks the binary to execute or doesn't
look like a binary tree. Refusing.
run: non-zero exit code: 1
Ending the build
谁能告诉我通常的方法来解决这个问题?
这是我的构建脚本:
#!/usr/bin/env bash
set -e
acbuildend () {
export EXIT=$?;
acbuild --debug end && exit $EXIT;
}
acbuild --debug begin
trap acbuildend EXIT
rm -f sputnik2.aci
acbuild set-name jhallpr.com/sputnik
acbuild dependency add quay.io/coreos/alpine-sh
acbuild run -- apk update
acbuild run -- apk add ruby ruby-io-console
acbuild copy-to-dir ./sputnik2 /usr/src/app/sputnik2
acbuild set-working-directory /usr/src/app/sputnik2
acbuild run -- gem install bundler --no-doc --no-ri
acbuild run -- /bin/sh -c "bundle install" # <-- *falls over here*
acbuild set-exec -- /usr/bin/ruby sputnik2.rb
acbuild write sputnik2.aci
请注意,我在这里去掉了(acbuild run -- /bin/sh -c...
),因为当它作为根运行时,捆绑器会报错。但符号连接似乎是一个很常见的问题。例如,如果我通过acbuild run -- apk add
安装捆绑器,脚本会抱怨bundle
是一个符号链接…
升级到systemd版本大于230。