Giter VIP home page Giter VIP logo

Comments (7)

nalind avatar nalind commented on July 20, 2024

Different storage drivers have different ways to handle removal of contents that were present in a lower layer. What's the intended result of creating a .wh.foo.repo file instead of just deleting foo.repo?

from imagebuilder.

sosiouxme avatar sosiouxme commented on July 20, 2024

Fair point, it seemed like a hack anyway.

Deleting a file (let's assume with RUN rm file) requires that the current USER have permission to delete the file, so it's not a simple inverse of ADD. In our case we're wanting to automate the addition of a yum repo file at the beginning of the Dockerfile and then removing it at the end (to supply a build repo written on the fly). This means we have to determine what the USER is supposed to be at the end and switch it like so:

USER root
RUN rm /etc/yum.repos.d/foo.repo
USER previous_user

And that assumes rm is even present -- if your base image is scratch that will break (so would using yum, but this is automation, it doesn't know if the repo will be needed or not).

As an alternative, we can ADD an empty file to overwrite it at the end, but then you have a useless empty file to confuse people. Ideally, we could mount the file as a volume during the build so it's never present in the container; but the repo file is generated in a container fs, so mounting it into the build container is complicated.

It would be great if there were a REMOVE instruction or ADD --remove option for removing files, or some other way for imagebuilder to facilitate this.

But if nothing else, this issue just serves as notice that the whiteout file hack works differently here.

from imagebuilder.

smarterclayton avatar smarterclayton commented on July 20, 2024

I think docker actually standardizes on the whiteout format inside the tar. The question is whether we can safely do that via the invocation of the command. You'd get into some interesting cases where whiteout doesn't have the same behavior.

from imagebuilder.

openshift-bot avatar openshift-bot commented on July 20, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

from imagebuilder.

openshift-bot avatar openshift-bot commented on July 20, 2024

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

from imagebuilder.

openshift-bot avatar openshift-bot commented on July 20, 2024

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

from imagebuilder.

openshift-ci-robot avatar openshift-ci-robot commented on July 20, 2024

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from imagebuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.