docker prints build error

Asked 2 years ago, Updated 2 years ago, 346 views

MacBook Air (Retina, 13-inch, 2020)
OS: macOS BigSur (version 11.4)
docker (Version: 20.10.7)

I tried to create a Ubuntu-based Python development environment using Docker, but I got the following error:

=>ERROR [internal] load build definition from Python 0.0s
 =>=>transferring dockerfile: 40B 0.0s
------
 >[internal] load build definition from Python:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: error from sender: open.Trash: operation not permitted
(base) imaimasayuki @imaimasayukinoMacBook-Air~%docker --version
Docker version 20.10.7, build f0df350

The dockerfile contains the following contents:

 FROM ubuntu:latest

RUN apt-get update & apt-get install-y sudo get vim curl gawk make gcc

RUN wget https://repo.continuum.io/archive/Anaconda3-2019.03-Linux-x86_64.sh & \
    sh Anaconda3-2019.03-Linux-x86_64.sh-b&&\
    rm-f Anaconda3-2019.03-Linux-x86_64.sh &\
    sudo curl-sL https://deb.nodesource.com/setup_10.x | sudo bash-&&\
    sudo apt-get install-y nodejs

ENV PATH$PATH: /root/anaconda3/bin

RUN pip install --upgrade pip
RUN pip install pandas_datareader
RUN pip install mplfinance

RUN wget --quiet http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz-Ota-lib-0.4.0-src.tar.gz&\
    tar xvfta-lib-0.4.0-src.tar.gz&\
    cdta-lib/&&\
    ./configure --prefix=/usr&&\
    make & make &\
    sudo make install&&\
    cd..&\
    pip install TA-Lib & & \
    rm-Rta-lib ta-lib -0.4.0-src.tar.gz

RUN mkdir/workspace

CMD ["jupyter-lab", "--ip=0.0.0", "--port=8888", "--no-browser", "--allow-root", "--LabApp.token='" ]

Then, I built it with the following command:

 docker build-t jlab:latest-f Python/PATH/

I spend a lot of time because I don't know what is causing the event.
Thank you for your cooperation.

docker

2022-09-30 21:59

1 Answers

If you are running on a mac terminal, it is likely that you do not have sufficient privileges.
Add terminal to system configuration ->security ->full disk access as shown in the link below.
https://apple.stackexchange.com/questions/376916/cannot-ls-trash-in-the-terminal-in-catalina-operation-not-permitted

If you have security concerns, place the dockerfile where the terminal can access it and build it there.
For example, a desktop. https://teratail.com/questions/327273

Additional
Once you have moved it to your desktop, run the following command:

cd through /Desktop
docker build-t jlab:latest. 


2022-09-30 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.