If I run this

#!/bin/bash

ARCH=$(python fetch_architecture.py)
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
    export PATH=/opt/local/llvm/bin:${PATH}
    cd /app
    RUSTFLAGS="-C linker=lld" wasm-pack build --target web --release plume-front
else
    wasm-pack build --target web --release plume-front
fi

via the terminal, it works just fine. But when I run it via the Dockerfile,

COPY . . 
RUN cargo install wasm-pack 
RUN chmod a+x ./script/plume-front.sh 
RUN sleep 1 
RUN ./script/plume-front.sh

It says python: command not found and then [: too many arguments

  • thenextguy@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    5 months ago

    Python is not on the Path for docker. The error message “python: command not found” is then passed to the [ command (also called test) which says too many arguments.

    Add the path /use/bin/ to your python command. Or figure out why it isn’t on the docker path.