Description of problem:
the .dockerignore file is not respected by the docker strategy build. It is respected when using the image layer optimization option (which uses imagebuilder under the covers).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a repo with a Dockerfile and .dockerignore
2. The Dockerfile needs to "ADD . /tmp"
3. Build the repo using a docker strategy on openshift
files listed in .dockerignore should are present in the final image's /tmp dir when using the default docker strategy (but not when using the imagelayer optimization).
files listed in .dockerignore should not be present in the final image's /tmp dir
This is because we blindly tar the workdir and send it to the docker daemon:
Clayton can you add some details about what tool we should be using to create the tar instead?
(not a regression, so pushing this out).
(still not a regression, still pushing this out, though will try to get to it still)
attempt that ended in a dead end: https://github.com/openshift/source-to-image/pull/809
This should be resolved in 4.0 by the move to buildah. Adam can you test this on a 4.0 cluster?
This appears to remain an issue. Need to dig a bit further to confirm.
Confirmed that this is an issue with buildah.
Requested https://github.com/containers/buildah/issues/699 to be repopened.
With the introduction of OpenShift 4, Red Hat has delivered or roadmapped a substantial number of features based on feedback by our customers. Many of the enhancements encompass specific RFEs which have been requested, or deliver a comparable solution to a customer problem, rendering an RFE redundant.
This bz (RFE) has been identified as a feature request not yet planned or scheduled for an OpenShift release and is being closed.
If this feature is still an active request that needs to be tracked, Red Hat Support can assist in filing a request in the new JIRA RFE system, as well as provide you with updates as the RFE progress within our planning processes. Please open a new support case: https://access.redhat.com/support/cases/#/case/new
Opening a New Support Case: https://access.redhat.com/support/cases/#/case/new
As the new Jira RFE system is not yet public, Red Hat Support can help answer your questions about your RFEs via the same support case system.
Adam, it looks like https://github.com/containers/buildah/issues/699 was resolved. Should this BZ instead be marked as fixed in 4.1.0?
Ben - this is correct. Now that we're using buildah, .dockerignore should just work. QE team should be able to verify this was fixed with 4.1.0.
We should create new BZs if there are further issues with .dockerignore files.
Eric we wanted QE to verify this.
│ ├── sub1.txt
│ └── sub2.txt
1 directory, 5 files
$ more .dockerignore
TEP 3: RUN ls -lR /tmp/src
drwx------. 2 root root 22 Jun 17 06:27 subdir
-rw-rw-r--. 1 root root 6 Jun 17 06:26 test2.txt
-rw-rw-r--. 1 root root 9 Jun 17 06:26 sub1.txt
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.