The following error will be printed when attempting to build the Dockerfile:

Asked 2 years ago, Updated 2 years ago, 43 views

When I create a Dockerfile and try to build it, I get the following error:

Environment:
Windows 10 Home version 20H2 build 19042.630
Ubuntu 18.04
Docker version 19.03.13

commands executed:

docker build-tubuntu:18.04\PATH\

error messages:

[+]Building 0.0s(2/2)FINISHED
 =>[internal] load build definition from Dockerfile 0.0s
 =>=>transferring dockerfile:2B 0.0s
 =>[internal] load.dockerignore 0.0s
 =>=>transferring context—2B 0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open/var/lib/docker/tmp/buildkit-mount 985632545/Dockerfile: no such file or directory

DockerFile

 FROM ubuntu: 18.04

# setup timezone
# https://sleepless-se.net/2018/07/31/docker-build-tzdata-ubuntu/
RUN DEBIAN_FRONTEND = noninteractive
RUN apt-get update & apt-get install-y tzdata
# timezone setting
ENV TZ = Asia / Tokyo

# print command
RUN set-x

# install utility command
RUN apt-get update &&\
    apt-get install-y --no-install-recommendations wget sudo software-properties-common build-essential

# install jupyter
# https://daichan.club/linux/78323
RUN sudo apt-get update&&\
    mkdir downloads &&\
    wget-q https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh-P./downloads/&\
    bash./downloads/Anaconda3-2018.12-Linux-x86_64.sh-b
ENV PATH$PATH: /root/anaconda3/bin
# setup jupyter
RUN jupyter notebook -- generate-config & & \
    sed-i-e"s/#c.NotebookApp.ip='localhost'/c.NotebookApp.ip='0.0.0.0'/"/root/.jupyter/jupyter_notebook_config.py&\
    sed-i-e"s/#c.NotebookApp.allow_remote_access=False/c.NotebookApp.allow_remote_access=True/"/root/.jupyter/jupyter_notbook_config.py

# install packages
RUN conda install-y-conda-forge pystan

EXPOSE 8900

docker

2022-09-29 21:56

1 Answers

Is the Dockerfile filename "dockerfile" or something like that?

DYou must rename it ockerfile or explicitly specify a Dockerfile with the -f option.

Examples of execution:

docker build-tubuntu:18.04-f dockerfile\PATH\

reference:

Docker cannot build -teratail answers


2022-09-29 21:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.