aitorniz / sedona3D

Working on a Sedona upgraded version designed for 3D data
0 stars 0 forks source link

Error while running the Dockerfile: bash file not found in PATH #1

Open aitorniz opened 2 months ago

aitorniz commented 2 months ago

Hi,

i'm configuring the Dockerfile in order to deploy my container inside the VM in the remote server I use. After running docker run -it idCOntainer bash I got the following error:

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: crun: executable file `bash` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found

Here's how my Dockerfile looks like:

FROM alpine:latest

WORKDIR /opt/workspace/penduick/

# install necessary tools

RUN apk update && apk add --no-cache \
        nano \
        git \
        vim \
        curl \
        wget \
        tar \
        gzip \

# install sbt
RUN sudo rm -f /etc/yum.repos.d/bintray-rpm.repo || true \
    curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo \
    sudo mv sbt-rpm.repo /etc/yum.repos.d/ \
    sudo yum install sbt \

# put spark in a more general directory
WORKDIR /opt/workspace/
# install spark
RUN wget "https://dlcdn.apache.org/spark/spark-3.4.3/spark-3.4.3-bin-hadoop3.tgz" && tar -xvf spark-3.4.3-bin-hadoop3.tgz

WORKDIR /opt/workspace/

# set up some environments
ENV SPARK_HOME="/opt/workspace/"
ENV PATH=$PATH:$SPARK_HOME/bin
ENV PYTHONPATH=$PATH:$SPARK_HOME/Python

#Copy all files into the container
COPY .  workspace/

#Set the defaut command for running scala
CMD ["sbt", "run"]

But I think the error is here:

WORKDIR /opt/workspace/

# set up some environments
ENV SPARK_HOME="/opt/workspace/"
ENV PATH=$PATH:$SPARK_HOME/bin
ENV PYTHONPATH=$PATH:$SPARK_HOME/Python

But I definetelly don't know what to do.

Could you help me please ? Thank you so much

JulienPeloton commented 2 months ago

Why your PYTHONPATH contains $PATH? It should be:

ENV PYTHONPATH=$PYTHONPATH:$SPARK_HOME/Python

Then, I'm not sure you need the CMD instruction at the end. Just remove it, and rebuild :-)

JulienPeloton commented 2 months ago

autre chose, tu utilises alpine comme image, mais tu installes sbt avec yum?

aitorniz commented 2 months ago

ThX, I fixed the typo in PATH. It seems weird but it works by running this: docker run -it imageId /bin/.sh I've just seen that Alpine is different from usual RPM and DEB. It scares me a bit. I'll try to build another pulling Apache/Sedona