0

My folder is created within a pipeline and its a transform artifact, looking like this:

TransformArtifact/
├─ deployment/
│  ├─ base_configs/
│  │  ├─ lambda/
│  │  │  ├─ appconfig.json
├─ lambda/
│  ├─ Dockerfile

Inside my dockerfile, the following line throws an error, because it references a wrong path that's later copied.

ARG APP_CONFIG_PATH=TransformArtifact/deployment/base_configs/lambda/

I've also tried ./deployment/base_configs/lambda/, it still wouldn't work. How do I reference the lambda folder within my base_configs folder?

The full path of the Dockerfile, for example, is: /home/vsts/work/1/TransformArtifact/lambda/Dockerfile. Yes, I've also tried putting the full path in front of it.

TFaws
  • 193
  • 2
  • 4
  • 15
  • 1
    How are you building the image? You can never `COPY` a file from outside the build-context directory; if you're trying to `COPY TransformArtifact/...` then you need to start from a parent directory, like `docker build -f TransformArtifact/lambda/Dockerfile ../`. Also see [How to include files outside of Docker's build context?](https://stackoverflow.com/questions/27068596/how-to-include-files-outside-of-dockers-build-context) – David Maze Mar 18 '22 at 17:49
  • This is what the build command looks like `/usr/bin/docker build -f /home/vsts/work/1/TransformArtifact/lambda/Dockerfile` – TFaws Mar 18 '22 at 18:01
  • That command is missing a path argument. Is there a `.` at the end of it? In that directory tree, what directory are you starting from? – David Maze Mar 18 '22 at 19:24

0 Answers0