GithubHelp home page GithubHelp logo

Comments (3)

micahyoung avatar micahyoung commented on June 30, 2024

After some experimenting, we found this is not fixable in imgutil. The only valid type of value for header.LinkName would be a relative path (ex my-link => bin/detect) and those already work without a Files prefix.

Absolute paths also don't work for Linux tar.Writer (they're copied over completely and not rewritten by Docker on extraction) so likewise on Windows, a user would need to set the correct absolute path value for header.Linkname.

Here are some examples from pack. We added some different types of symlinks to a sample buildpack, created a builder image from them, then got this output via docker run on that builder image. Note that both Windows and Linux have identical behavior (they just set the generated symlinks to have the exact values of the original symlinks).

Windows:

12/31/1979  05:00 PM    <DIR>          bin                                
12/31/1979  05:00 PM               162 buildpack.toml                     
12/31/1979  05:00 PM    <SYMLINK>      dirlink-absolute-bin [\Users\micah\workspace\pack\sandbox\hello-windows\bin]                       
12/31/1979  05:00 PM    <SYMLINK>      dirlink-absolute-buildpack.toml [\Users\micah\workspace\pack\sandbox\hello-windows\buildpack.toml] 
12/31/1979  05:00 PM    <SYMLINK>      dirlink-relative-bin [bin]                       
12/31/1979  05:00 PM    <SYMLINK>      dirlink-relative-buildpack.toml [buildpack.toml] 
12/31/1979  05:00 PM    <SYMLINK>      dirlink-relback-bin [..\hello-windows\bin]       
12/31/1979  05:00 PM    <SYMLINK>      dirlink-relback-buildpack.toml [..\hello-windows\buildpack.toml]

Linux:

drwxr-xr-x 2 root root 4096 Jan  1  1980 bin
-rwxr-xr-x 1 root root  162 Jan  1  1980 buildpack.toml
lrwxrwxrwx 1 root root   53 Jan  1  1980 dirlink-absolute-bin -> /Users/micah/workspace/pack/sandbox/hello-windows/bin
lrwxrwxrwx 1 root root   64 Jan  1  1980 dirlink-absolute-buildpack.toml -> /Users/micah/workspace/pack/sandbox/hello-windows/buildpack.toml
lrwxrwxrwx 1 root root    3 Jan  1  1980 dirlink-relative-bin -> bin
lrwxrwxrwx 1 root root   14 Jan  1  1980 dirlink-relative-buildpack.toml -> buildpack.toml
lrwxrwxrwx 1 root root   20 Jan  1  1980 dirlink-relback-bin -> ../hello-windows/bin
lrwxrwxrwx 1 root root   31 Jan  1  1980 dirlink-relback-buildpack.toml -> ../hello-windows/buildpack.toml

from imgutil.

ekcasey avatar ekcasey commented on June 30, 2024

Absolute paths also don't work for Linux tar.Writer (they're copied over completely and not rewritten by Docker on extraction) so likewise on Windows, a user would need to set the correct absolute path value for header.Linkname.

Can you elaborate on this part a little. If you explicitly set header.Linkname to an absolute path that will exist in the container, docker will not handle it correctly when creating the container?

from imgutil.

micahyoung avatar micahyoung commented on June 30, 2024

Sorry for no reply. I'm afraid I lost the context on this and I feel like this has been sorted out with the slice-related lifecycle changes, so incoming symlinks are sure to have the correct value on both OSes

from imgutil.

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.