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

Implement support for dockerignore and containerignore #1205

Merged
merged 6 commits into from
Jan 24, 2024

Commits on Jan 19, 2024

  1. feat: implement support for dockerignore and containerignore

    Currently repo2docker creates a context object that includes the whole content
    of the repository it builds an image for. Thus it includes folders like .git
    which is usually something that has no interest in the final image, can take
    quite a lot of space and most importantly, kills the caching of that layer.
    
    This patch adds support for reading dockerignore and containerignore files that
    are used to ensure only the relevant data are used to build the image.
    
    By default it also excludes the .git folder if neither of these files are
    provided.
    sgaist committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    6b8b233 View commit details
    Browse the repository at this point in the history
  2. fix: create src directory in any case

    The original behavior was to create an src directory with the content of the
    repository. The creation would happen in any case (remote or local repository).
    With the filtering in place and the default to remove the .git folder, it breaks
    the build as the src folder can be missing.
    
    This patch ensures that the directory is present in the tar so the build can
    continue as it did until now.
    sgaist committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    3028d07 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d6670f4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a51235f View commit details
    Browse the repository at this point in the history
  5. feat: respect the root folder configured when looking for ignore files

    See the design chapter for more details.
    sgaist committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    09e503c View commit details
    Browse the repository at this point in the history
  6. test(venv): add ignore files above binderdir

    This ensures that the ignore files are retrieved from the proper folder.
    If they weren't the build would not succeed as the binder folder is
    ignored.
    sgaist committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    77df191 View commit details
    Browse the repository at this point in the history