Building from remote repository via ssh doesn't respect .dockerignore
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
docker==4.2.1
Python 3.8.1
Docker engine: 19.03.6
OS: Mint 19.3
I tried to build an docker image from a remote repository via ssh. But each time the resulting image was different. I thought that maybe it is because of missing .dockerignore file and changing .git directory. So I created it but nothing changed. Everything is fine when I'm using docker build command (.dockerignore is respected and every time built image is the same - from cache).
I created trivial repository to reproduce the issue. https://github.com/nekeal/dockerignore-test
You should clone this repo, install requirements pip install -r requirements.txt and run script which builds image with python cli.py
Current behaviour
.git directory is included in image.
Expected behaviour
.git is absent in image.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Install the requirements from the reproduction repository and run its cli.py script to exercise the SSH-based remote build. Compare that path with docker build, focusing on how .dockerignore is handled. Done means .git is absent from the resulting image and repeated builds can reuse the expected cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100