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

add .dockerignore file #128

Closed
cjyetman opened this issue Feb 12, 2024 · 0 comments · Fixed by #129
Closed

add .dockerignore file #128

cjyetman opened this issue Feb 12, 2024 · 0 comments · Fixed by #129
Assignees
Labels

Comments

@cjyetman
Copy link
Member

cjyetman commented Feb 12, 2024

For this one, since it's not actually an R package, probably not. but in general, the .Xignore files, such as .Rbuildignore and .dockerignore can have huge impacts on build processes. (I'm annoyed that they're dotfiles).

As a quick example, .dockerignore excludes files from the docker build context, which means that when you have a line like this (currently on main):

if you don't have a .dockerignore defined, everything in the build context gets pulled into the image, which means that if you happen to have a copy of the rawdata inputs and outputs in the same directory, those get added. As does the .git directory, meaning that ever time you commit, you're invalidating the cache (and these problems multiply each other).

Originally posted by @AlexAxthelm in #117 (comment)

https://docs.docker.com/build/building/context/#dockerignore-files

@AlexAxthelm AlexAxthelm self-assigned this Feb 12, 2024
cjyetman added a commit that referenced this issue Feb 13, 2024
closes #128 

based on
https://github.com/RMI-PACTA/workflow.pacta/blob/main/.dockerignore with
the following differences
- allowing markdown files because I think it is reasonably relevant to
have the license and README markdown files baked into the image along
with the associated code
- excluding the `docker-compose.yml` because that's not relevant inside
the image (and I wonder if in some cases it could be a security concern,
e.g. if one did not want local path specifications to be revealed inside
the image)

---------

Co-authored-by: Alex Axthelm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants