Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance buildDockerImage error handling and include all context files #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plarson
Copy link

@plarson plarson commented Feb 6, 2025

This allows builds with an explicit Dockerfile to include files from the build context. The build process now includes all files in the specified build context directory. This is because Dockerode already respects the .dockerignore file, which means that while unnecessary files are filtered out, all relevant files must be present in the context for a successful build.

For example if you try to copy a script into the Docker image while using an explicit Dockerfile you would get this error:
{"errorDetail":{"message":"COPY failed: file not found in build context or excluded by .dockerignore: stat config.sh: file does not exist"},"error":"COPY failed: file not found in build context or excluded by .dockerignore: stat config.sh: file does not exist"}

This also addresses issues related to error handling in the buildDockerImage function within the lib/servicesTools.js file. Previously, errors during the Docker image build process were failing silently, making it difficult to diagnose problems. This update enhances error detection and ensures that all relevant files in the build context directory are included in the build process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant