How to copy file from host to container using Dockerfile

前端 未结 7 1203
Happy的楠姐
Happy的楠姐 2020-12-13 03:11

I have written a Dockerfile which looks like this

FROM ubuntu:12.04

RUN apt-get update
RUN apt-get install -y wget

Now I\'m having a file

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 04:06

    I got the following error using Docker 19.03.8 on CentOS 7:

    COPY failed: stat /var/lib/docker/tmp/docker-builderXXXXXXX/abc.txt: no such file or directory
    

    The solution for me was to build from Docker file with docker build . instead of docker build - < Dockerfile.

提交回复
热议问题