docker ADD with symlinks

  docker, symlink, ubuntu, ubuntu-20.04, wsl-2

When I do sudo docker build -t test -f 7.1/Dockerfile . docker fails on step 8/10:

Step 8/10 : ADD etc/php /usr/local/etc/php
ADD failed: file not found in build context or excluded by .dockerignore: stat etc/php: file does not exist

I don’t understand. etc/php is symlinked to another directory. Shouldn’t that work?

If I do ls -latr etc/php I get this:

lrwxrwxrwx 1 scbn scbn 43 Sep 11 17:48 etc/php -> /home/neubert/devops/containers/common/etc/php

If I do cd etc/php && ls -latr I get this:

total 84
drwxr-xr-x 2 scbn scbn  4096 Jan  3  2021 conf.d
drwxr-xr-x 5 scbn scbn  4096 Jan  3  2021 ..
-rw-r--r-- 1 scbn scbn 70125 Jan 26  2021 php.ini
drwxr-xr-x 3 scbn scbn  4096 Jan 26  2021 .

Source: Docker Questions

LEAVE A COMMENT