Docker Community Forums

Share and learn in the Docker community.

Add folder from / to ~ in docker image

I am trying to copy a directory from / to ~ in an alpine image and getting the below error… dir does exist in /. Thank you :).

FROM alpine:3.13.5

WORKDIR /path/to

RUN cd ../..

COPY dir/ .

COPY failed: stat /var/lib/docker/tmp/docker-builder455482071/dir: no such file or directory

Edit:

I can get to the dir after the image builds, but it is empty. Outside of the image:

dir

 folder1
 file1
 file2

 folder2
 file1