diff --git a/Dockerfile b/Dockerfile index 8e1a01c..134f1db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM ubuntu:22.04 ARG RUST_TOOLCHAIN="1.75.0" -ARG ARCH # Adding rust binaries to PATH. ENV PATH="$PATH:/root/.cargo/bin" diff --git a/build_container.sh b/build_container.sh index 84519a2..13142d2 100755 --- a/build_container.sh +++ b/build_container.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -ex +ARCH=$(uname -m) + apt-get update # DEBIAN_FRONTEND is set for tzdata. @@ -18,10 +20,11 @@ DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ apt-get clean && rm -rf /var/lib/apt/lists/* # help musl-gcc find linux headers -cd /usr/include/$ARCH-linux-musl \ - && ln -s ../$ARCH-linux-gnu/asm asm \ - && ln -s ../linux linux \ - && ln -s ../asm-generic asm-generic +pushd /usr/include/$ARCH-linux-musl +ln -s ../$ARCH-linux-gnu/asm asm +ln -s ../linux linux +ln -s ../asm-generic asm-generic +popd pip3 install --no-cache-dir pytest pexpect boto3 pytest-timeout && apt purge -y python3-pip @@ -43,7 +46,7 @@ rustup component add miri rust-src --toolchain nightly rustup component add llvm-tools-preview # needed for coverage # Install other rust targets. -rustup target add $(uname -m)-unknown-linux-musl $(uname -m)-unknown-none +rustup target add $ARCH-unknown-linux-musl $ARCH-unknown-none cargo install cargo-llvm-cov diff --git a/docker.sh b/docker.sh index c4ebaa6..3f3fa0a 100755 --- a/docker.sh +++ b/docker.sh @@ -40,7 +40,7 @@ build(){ docker build -t "$new_tag" \ --build-arg GIT_BRANCH="${GIT_BRANCH}" \ --build-arg GIT_COMMIT="${GIT_COMMIT}" \ - -f Dockerfile --build-arg ARCH="${ARCH}" . + -f Dockerfile . echo "Build completed for $new_tag" }