question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing files from docker image

See original GitHub issue

Bug

Current Behavior

It seems sometimes the garden.io builds incorrectly the docker image. Somehow one file is missing from the image that is there in the source folder in my machine. Files are missing according to the error log. The missing file is not always the same.

garden build -> The build is successful. garden deploy -> The deploy process sometimes works fine, sometimes fails with a custom error (because of the missing files). Moreover, when the deployment process is fine too, sometimes the running pod crashes because of the same error. So either shows the error already during deployment or in the running container after deployment.

It’s important to mention that sometimes everything works great, and then after a few minutes this error occurs, even though nothing changes in the source code that can cause it. It seems random to me.

If I see in the container what is built from the image what the garden.io built, I really can’t find the files there that should be there.

Expected behavior

Workaround

Need to run the garden deploy or garden dev more than once. It can be up to 10.

Your environment

  • OS: Windows 10
  • Garden.io version: 0.12.18
  • How I’m running Kubernetes: Remote cluster
  • buildMode: cluster-docker

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
edvaldcommented, Mar 26, 2021

Sorry, should have clarified, that’s an environment variable in your shell.

0reactions
gustaff-weldoncommented, Oct 7, 2022

@edvald I think I’m facing a similar problem. garden deploy (v0.12.44) fails with

> [development  2/14] COPY   tmp/docker-build/external-files/avro-schemas/   /avro-schemas/:
------
failed to compute cache key: "/tmp/docker-build/external-files/avro-schemas" not found: not found

1 deploy action(s) failed!

I have tried GARDEN_LEGACY_BUILD_STAGE=true garden deploy, same error.

My .garden is very minimal:

kind: Module
type: container
name: foo

build:
  targetImage: development

dockerfile: Dockerfile

services:
  - name: foo
    ports:
      - name: http
        containerPort: 3000

My Dockerfile.dockerignore:

*

!/app/
...
<snip>
!tmp/docker-build/external-files/

I’ve checked .garden/build/<project>/ in monorepo root folder and it is missing the tmp folder, which exists in my project directory and is not excluded in Dockerfile.dockerignore. The .garden/build/<project>/ folder, is also missing the aforementioned dockerignore file.

What drives the list of files that are being copied to build folder?

Also I wonder, why does garden even need to copy all the module files to that project .garden/build/ folder? It looks inefficient. If I were to use garden in all my projects in the monorepo (I’m currently evaluating garden) it seems, I would end up with almost a copy my monorepo in that .garden/build folder…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files mysteriously missing in docker image - Stack Overflow
I inspect the content of the folder /home/node/app using SSH. So far all good. I push the image to my docker registry. I...
Read more >
[RESOLVED] Files missing after Dockerfile RUN downloads ...
My workaround at this point is to execute a container that runs the shell script to download the application followed by running the...
Read more >
How to fix missing file error with Docker Container - YouTube
In this video, We shall learn how to fix missing errors on the docker container.https://www.youtube.com/watch?v=0ZS2BL5R3OwPlease follow ...
Read more >
Missing files after installing package on NGINX Docker image
1. Building a Docker image with the package. FROM nginx:latest RUN apt-get update \ && apt-get -q install -y \ fcgiwrap \ &&...
Read more >
Files/folders go missing when building multi-stage docker ...
I have two dockerfiles that I use to build a docker image that's deployed as a AWS Lambda. and I would like to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found