我正在Ubuntu机器上运行docker [Docker版本17.06.2-ce,构建a04f55b]。
只需从docker进行一次非常简单的练习即可构建docker映像:https://docs.docker.com/get-started/part2/#apppy
在运行以下命令时
sudo docker build -t friendlyhello .
我收到以下错误
error checking context: 'can't stat '/home/xyz/docker_experiments''.
我了解这与装甲和权限有关。
根据要求,这是Dockerfile
# Use an official Python runtime as a parent image
FROM python:2.7-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["python", "app.py"]
答案 0 :(得分:1)
可能是权限问题。
您可以尝试的2件事:
mkdir /docker/test
cp . /docker/test
cd /docker/test
sudo docker build -t friendlyhello .