osbuilder: fix alpine agent build

Since we always build musl kata-agent, there is no need to build
it inside a musl container. We can just build on the host and then
copy the binary to the target rootfs.

There are still a lot to clean up and it should be made so for ALL
target distros instead of just alpine. But this is at least working
for alpine first.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2020-07-20 17:10:01 +08:00
parent 5216815d1c
commit 76c18aa345
14 changed files with 40 additions and 126 deletions

View File

@@ -7,15 +7,11 @@
set -e
KATA_REPO=${KATA_REPO:-github.com/kata-containers/kata-containers}
KATA_REPO_DIR="${GOPATH}/src/${KATA_REPO}"
CMAKE_VERSION=${CMAKE_VERSION:-"null"}
MUSL_VERSION=${MUSL_VERSION:-"null"}
#https://github.com/kata-containers/tests/blob/master/.ci/jenkins_job_build.sh
# Give preference to variable set by CI
KATA_BRANCH=${branch:-}
KATA_BRANCH=${KATA_BRANCH:-master}
yq_file="${script_dir}/../scripts/install-yq.sh"
kata_versions_file="${KATA_REPO_DIR}/versions.yaml"
yq_file="${script_dir}/../../../ci/install_yq.sh"
kata_versions_file="${script_dir}/../../../versions.yaml"
error()
{
@@ -199,7 +195,7 @@ create_summary_file()
if [ "${RUST_AGENT}" == "no" ]; then
agent_version=$("$agent" --version|awk '{print $NF}')
else
local -r agentdir="${GOPATH}/src/${KATA_REPO}/src/agent"
local -r agentdir="${script_dir}/../../../"
agent_version=$(cat ${agentdir}/VERSION)
fi