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

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    5 months ago

    You should use python3 anyway not python. The latter is sometimes Python 3, sometimes Python 2 and sometimes doesn’t exist. python3 works reliably, assuming you have it installed.

    (And assuming you aren’t using the official Windows Python installer, but that doesn’t seem like the case here!)

    • sabreW4K3@lazysoci.alOP
      link
      fedilink
      arrow-up
      3
      ·
      5 months ago

      I ended up adding Python3 as it moaned when I just added Python. Thank you so much for your advice though. I’m grateful.